Пример #1
0
def tester():
    sleep(0.3)
    qb = qbroker.make_unit_gevent(
        app="test.qbroker", amqp=dict(server=dict(virtualhost="/test", login="******", password="******"))
    )
    qb.register_alert_gevent("moat.event.#", event_cb, call_conv=CC_DICT)
    r1 = qb.rpc_gevent("moat.list", _timeout=1)
    r2 = qb.rpc_gevent("moat.list", args=("qbroker", "connection"), _timeout=1)
    r3 = qb.rpc_gevent("moat.cmd", args=("list", "qbroker", "connection"), _timeout=1)
    r4 = qb.rpc_gevent("moat.cmd", args=("list", "qbroker", "connection", "foo"), _timeout=1)
    r5 = qb.rpc_gevent("moat.cmd", args=("del", "wait", "shutdown"), _timeout=1)
    sleep(0.3)
    qb.stop_gevent()
Пример #2
0
	def connect(self):
		d = dict()
		if self.s.port:
			d['port'] = self.s.port
		if self.s.username:
			d['login'] = self.s.username
		if self.s.password:
			d['password'] = self.s.password
		if self.s.virtualhost:
			d['virtualhost'] = self.s.virtualhost
		try:
			self.qb = qbroker.make_unit_gevent("moat.rain.runschedule", amqp=dict(server=dict(host=self.s.host, **d)))
		except Exception:
			print("Could not connect:",self.s.host, file=sys.stderr)
			raise
Пример #3
0
 def connect(self):
     d = dict()
     if self.s.port:
         d['port'] = self.s.port
     if self.s.username:
         d['login'] = self.s.username
     if self.s.password:
         d['password'] = self.s.password
     if self.s.virtualhost:
         d['virtualhost'] = self.s.virtualhost
     try:
         self.qb = qbroker.make_unit_gevent(
             "moat.rain.runschedule",
             amqp=dict(server=dict(host=self.s.host, **d)))
     except Exception:
         print("Could not connect:", self.s.host, file=sys.stderr)
         raise
Пример #4
0
def tester():
    sleep(0.3)
    qb = qbroker.make_unit_gevent(
        app="test.qbroker",
        amqp=dict(
            server=dict(virtualhost="/test", login="******", password="******")))
    qb.register_alert_gevent("moat.event.#", event_cb, call_conv=CC_DICT)
    r1 = qb.rpc_gevent("moat.list", _timeout=1)
    r2 = qb.rpc_gevent("moat.list", args=("qbroker", "connection"), _timeout=1)
    r3 = qb.rpc_gevent("moat.cmd",
                       args=("list", "qbroker", "connection"),
                       _timeout=1)
    r4 = qb.rpc_gevent("moat.cmd",
                       args=("list", "qbroker", "connection", "foo"),
                       _timeout=1)
    r5 = qb.rpc_gevent("moat.cmd",
                       args=("del", "wait", "shutdown"),
                       _timeout=1)
    sleep(0.3)
    qb.stop_gevent()