def poll_mutation_queue(self):
"""
In this paradigm calling means pushing our message
to the queue (the callback will take care of it)
and wait for the response and process it.
@returns: string, serialized MutationObject (only attributes)
"""
self.response = None
self.corr_id = str(uuid.uuid4())
self.channel.basic_publish(exchange = '', # default exchange
routing_key = 'rpc_mutations_queue',
properties = pika.BasicProperties(
reply_to = self.callback_queue,
correlation_id = self.corr_id),
body = 'POLL MUTATION QUEUE')
self.ae.m_info("[x] Sent mutation queue poll")
while self.response is None:
# Waiting for a response
self.connection.process_data_events()
return self.response
评论列表
文章目录