Broker Worker API
Worker class for the Broker.
Worker
A Worker for the Broker, idle or active.
__init__(self, identity, address, lifetime)
special
Generate a worker entity for the Broker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
identity |
[type] |
unique worker identity |
required |
address |
[type] |
hexily addres of the worker |
required |
lifetime |
[timedelta] |
lifetime the worker can be conntected to the broker |
required |
Source code in loudify/broker_worker_api.py
def __init__(self, identity, address, lifetime):
"""Generate a worker entity for the Broker.
Args:
identity ([type]): unique worker identity
address ([type]): hexily addres of the worker
lifetime ([timedelta]): lifetime the worker can be conntected to the broker
"""
self.identity = identity
self.address = address
self.expiry = time.time() + 1e-3 * lifetime