This file contains hidden or 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
interface Person { | |
name: string; | |
age: number; | |
height: number; | |
friends: Person[]; | |
} | |
// Jane implicitly implements the person type | |
const jane = { | |
name: "Jane", |
This file contains hidden or 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
from queue import Queue | |
from threading import Thread | |
from typing import Any, List, Iterator | |
class PipeClose: | |
pass | |
class QueuePipe: |
This file contains hidden or 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
from queue import Queue, Empty | |
from threading import Thread | |
from typing import Any | |
import time | |
class Ticker: | |
_alive = True | |
_q = Queue() | |
_stop_q = Queue() |
This file contains hidden or 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
from queue import Queue | |
from threading import Thread | |
class KillSignal: | |
pass | |
class QueuePipe: | |
def __init__(self, queue_in: Queue, queue_out: Queue) -> None: |
This file contains hidden or 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
from typing import Type, Set, Any | |
from multiprocessing import Queue | |
import asyncio | |
class MulticastQueue: | |
def __init__(self, queue_constructor: Type[Queue] = Queue) -> None: | |
self.subscribers: Set[Queue] = set() | |
self.constructor = queue_constructor | |
def register(self) -> Queue: |
This file contains hidden or 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
from queue import Queue | |
from threading import Thread | |
from typing import cast | |
import asyncio | |
import janus | |
# note that this will never cleanup the thread. You will need to implement your own shutdown logic / methods. | |
def sync_to_async_queue(queue: Queue, loop: asyncio.AbstractEventLoop) -> asyncio.Queue: | |
conversion_queue: janus.Queue = janus.Queue(loop=loop) |
This file contains hidden or 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
from queue import Queue | |
from threading import Thread | |
from typing import Any, List, Iterator | |
class PipeClose: | |
pass | |
class PipeExtra: |
This file contains hidden or 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
import cv2 | |
import time | |
import numpy as np | |
import multiprocessing as mp | |
log_const = 30 | |
class FPS: |
This file contains hidden or 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
import cv2 | |
import time | |
import numpy as np | |
from threading import Thread | |
from queue import Queue | |
log_const = 30 | |