-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
392 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import queue | ||
from typing import Any | ||
from isar.models.communication.queues.status_queue import StatusQueue | ||
from isar.models.communication.queues.queue_io import QueueIO | ||
|
||
|
||
def trigger_event(queueio: QueueIO, data: any = None) -> Any: | ||
queueio.input.put(data if data != None else True) | ||
|
||
|
||
def check_shared_state(queueio: StatusQueue): | ||
try: | ||
return queueio.check() | ||
except queue.Empty: | ||
return None | ||
|
||
|
||
def check_for_event(queueio: QueueIO) -> Any: | ||
try: | ||
return queueio.input.get(block=False) | ||
except queue.Empty: | ||
return None |
Oops, something went wrong.