Merge in RR/pyinfra from prometheus-tunneling to pika_encapsulation
Squashed commit of the following:
commit 350448ec0f14849844deaa1a86ba4397ab3ebf3c
Author: Julius Unverfehrt <julius.unverfehrt@iqser.com>
Date: Wed Mar 9 16:52:02 2022 +0100
quickfix
commit ee88be4c80abdf597013c743ce2d490ad2b3e029
Author: Julius Unverfehrt <julius.unverfehrt@iqser.com>
Date: Wed Mar 9 15:26:19 2022 +0100
added prometheus endpoint to tunnel metrics from analysis endpoint
48 lines
917 B
Python
48 lines
917 B
Python
import abc
|
|
|
|
|
|
class QueueHandle:
|
|
def empty(self) -> bool:
|
|
raise NotImplemented()
|
|
|
|
def to_list(self) -> list:
|
|
raise NotImplemented()
|
|
|
|
|
|
class QueueManager(abc.ABC):
|
|
def __init__(self, input_queue, output_queue):
|
|
self._input_queue = input_queue
|
|
self._output_queue = output_queue
|
|
|
|
@abc.abstractmethod
|
|
def publish_request(self, request):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def publish_response(self, response, callback):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def pull_request(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def consume(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def clear(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def input_queue(self) -> QueueHandle:
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def output_queue(self) -> QueueHandle:
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
def consume_and_publish(self, callback):
|
|
pass
|