hololinked.core.eventloop.operations.Operation
dataclass
The eventloop's operation model - One operation to perform on one interaction affordance of one Thing.
The transport-neutral unit of work.
Source code in repo/hololinked/hololinked/core/eventloop/operations.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | |
Attributes
operation
instance-attribute
what to do with it - an Operations member such as readproperty or invokeaction.
payload
class-attribute
instance-attribute
the operation's argument, still encoded until the executing Thing deserializes it.
preserialized_payload
class-attribute
instance-attribute
binary argument that bypasses serialization entirely.
scheduler_execution_context
class-attribute
instance-attribute
scheduler_execution_context: SchedulerExecutionContext = field(default_factory=lambda: SchedulerExecutionContext(invokation_timeout=None, execution_timeout=None, oneway=False))
the timeouts, and whether a reply is wanted at all.
thing_execution_context
class-attribute
instance-attribute
thing_execution_context: ThingExecutionContext = field(default_factory=lambda: ThingExecutionContext(fetch_execution_logs=False))
what the Thing should do beside running the operation.
sender_id
class-attribute
instance-attribute
identifier of whoever asked. Logging only.
id
class-attribute
instance-attribute
identifier of the originating request. Correlation and logging only - never routed on.
Functions
__init__
__init__(thing_id: str, objekt: str, operation: str, payload: SerializableData = lambda: SerializableData(None)(), preserialized_payload: PreserializedData = lambda: PreserializedData(b'')(), scheduler_execution_context: SchedulerExecutionContext = lambda: SchedulerExecutionContext(invokation_timeout=None, execution_timeout=None, oneway=False)(), thing_execution_context: ThingExecutionContext = lambda: ThingExecutionContext(fetch_execution_logs=False)(), id: str = '', sender_id: str = '') -> None
qualified_name
A key identifying this operation on this affordance of this Thing.
create
classmethod
create(thing_id: str, objekt: str, operation: str, payload: SerializableData | None = None, preserialized_payload: PreserializedData | None = None, invokation_timeout: float | None = None, execution_timeout: float | None = None, oneway: bool = False, fetch_execution_logs: bool = False, id: str = '', sender_id: str = '') -> Operation
Initialize an operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
|
required |
|
str
|
name of the property, action or event |
required |
|
str
|
what to do with it, an |
required |
|
SerializableData | None
|
the operation's argument, still encoded |
None
|
|
PreserializedData | None
|
binary argument that bypasses serialization |
None
|
|
float | None
|
seconds to wait for the operation to start, |
None
|
|
float | None
|
seconds to wait for the operation to finish, |
None
|
|
bool
|
whether to discard the reply |
False
|
|
bool
|
whether to return the |
False
|
|
str
|
identifier of the originating request |
''
|
|
str
|
identifier of whoever asked |
''
|
Returns:
| Type | Description |
|---|---|
Operation
|
the operation, with the parameters grouped into their contexts |