How to use the cobald.interfaces.Pool function in cobald

To help you get started, we’ve selected a few cobald examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MatterMiners / tardis / tardis / resources / drone.py View on Github external
from tardis.interfaces.state import State
from .dronestates import RequestState
from .dronestates import DownState
from ..utilities.attributedict import AttributeDict
from cobald.daemon import service
from cobald.interfaces import Pool

from datetime import datetime

import asyncio
import logging
import uuid


@service(flavour=asyncio)
class Drone(Pool):
    def __init__(
        self,
        site_agent: SiteAgent,
        batch_system_agent: BatchSystemAgent,
        plugins: Optional[List[Plugin]] = None,
        remote_resource_uuid=None,
        drone_uuid=None,
        state: RequestState = RequestState(),
        created: float = None,
        updated: float = None,
    ):
        self._site_agent = site_agent
        self._batch_system_agent = batch_system_agent
        self._plugins = plugins or []
        self._state = state