hololinked.core.eventloop.operations.Job
dataclass
The operation wrapped around its lifecycle within the event loop.
Source code in repo/hololinked/hololinked/core/eventloop/operations.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
Attributes
started
instance-attribute
set when the operation started. The invokation timeout races against this.
completed
instance-attribute
set when the operation has completed. The execution timeout races against this.
invokation_timeout_task
class-attribute
instance-attribute
The timeout racing started. Awaited once started is set, to settle the race.
execution_timeout_task
class-attribute
instance-attribute
The timeout racing completed. Awaited once completed is set, to settle the race.
Functions
__init__
__init__(operation: Operation, future: Future, started: CrossLoopEvent, completed: CrossLoopEvent, invokation_timeout_task: Future | None = None, execution_timeout_task: Task | None = None) -> None
answer
Resolve the caller's future, unless a timeout already answered for us.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Reply
|
the outcome to hand back to whoever submitted |
required |
Source code in repo/hololinked/hololinked/core/eventloop/operations.py
answer_if_never_started
async
Answer the caller with an invokation timeout if this job has not left the queue in time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
seconds to wait for |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in repo/hololinked/hololinked/core/eventloop/operations.py
answer_if_overdue
async
Answer the caller with an execution timeout if the operation has not finished in time.
The operation is not cancelled - it cannot be - so its eventual reply is still drained by
EventLoop.tunnel_message_to_things(), then dropped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
seconds to wait for |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|