hololinked.client.abstractions.ConsumedThingEvent
Source code in hololinked\client\abstractions.py
Functions
__init__
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
EventAffordance
|
dataclass object representing the event |
required |
Source code in hololinked\client\abstractions.py
subscribe
subscribe(callbacks: typing.Union[typing.List[typing.Callable], typing.Callable], thread_callbacks: bool = False, deserialize: bool = True) -> None
subscribe to the event
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Union[List[Callable], Callable]
|
callback or list of callbacks to add |
required |
|
bool
|
whether to run each callback in a separate thread |
False
|
|
bool
|
whether to deserialize the event payload |
True
|
Source code in hololinked\client\abstractions.py
unsubscribe
unsubscribe from the event
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
bool
|
whether to join the event thread after unsubscribing |
True
|
Source code in hololinked\client\abstractions.py
listen
add_callbacks
add callbacks to the event
Parameters:
Name | Type | Description | Default |
---|---|---|---|
|
Union[List[Callable], Callable]
|
callback or list of callbacks to add |
()
|