Beispiel #1
0
    def __init__(self,
                 host,
                 port,
                 id=None,
                 ready_file=None,
                 user=None,
                 password=None,
                 cert=None,
                 key=None,
                 trust_store=None,
                 quiet=False,
                 verbose=False,
                 init_only=False):
        self.host = host
        self.port = port
        self.id = id
        self.user = user
        self.password = password
        self.ready_file = ready_file
        self.cert = cert
        self.key = key
        self.trust_store = trust_store
        self.quiet = quiet
        self.verbose = verbose
        self.init_only = init_only

        if self.id is None:
            self.id = "broker-{0}".format(str(_uuid.uuid4())[:8])

        self.container = _reactor.Container(_Handler(self))
        self.container.container_id = self.id  # XXX Obnoxious

        self._config_dir = None
Beispiel #2
0
    def __init__(self):
        super().__init__()

        self.container = _reactor.Container(_Handler(self))
        self.container.container_id = "test-broker"

        self.quiet = False
        self.verbose = True
Beispiel #3
0
    def __init__(self, app, host="", port=5672):
        super().__init__()

        self.app = app
        self.host = host
        self.port = port

        self.container = _reactor.Container(MessagingHandler(self))
        self.container.container_id = f"stagger-{self.container.container_id}"

        self.events = _reactor.EventInjector()
        self.container.selectable(self.events)

        self.daemon = True
Beispiel #4
0
    def __init__(self, host, port, id=None, user=None, password=None, ready_file=None):
        self.host = host
        self.port = port
        self.id = id
        self.user = user
        self.password = password
        self.ready_file = ready_file

        if self.id is None:
            self.id = "broker-{0}".format(_uuid.uuid4())

        self.container = _reactor.Container(_Handler(self))
        self.container.container_id = self.id # XXX Obnoxious

        self._config_dir = None
Beispiel #5
0
    def __init__(self, id=None):
        self._proton_object = _reactor.Container(_Handler(self))

        if id is not None:
            self._proton_object.container_id = id

        self._operations = _queue.Queue()
        self._worker_thread = _WorkerThread(self)
        self._lock = _threading.Lock()

        self._event_injector = _reactor.EventInjector()
        self._proton_object.selectable(self._event_injector)

        # proton endpoint => gambit endpoint
        self._endpoints = dict()

        self._connections = set()
Beispiel #6
0
    def __init__(self, home_dir, name, handler):
        super(MessagingCommand, self).__init__(home_dir, name)

        self.container = _reactor.Container(handler)

        self.events = _reactor.EventInjector()
        self.container.selectable(self.events)

        self.input_file = _sys.stdin
        self.input_thread = _InputThread(self)
        self.input_messages = _collections.deque()

        self.output_file = _sys.stdout

        self.ready = _threading.Event()
        self.done = _threading.Event()

        self.add_argument("--id", metavar="ID",
                          help="Set the container identity to ID")
Beispiel #7
0
    def run(self):
        handler = _DrainHandler(self)
        container = _reactor.Container(handler)

        container.run()
Beispiel #8
0
    def run(self):
        handler = _BrokerHandler(self)
        container = _reactor.Container(handler)
        container.container_id = "quiver-server-builtin"

        container.run()