def _get_queue_arguments(self, ttl=None, expires=None): conf = self.app.conf return dictfilter({ 'x-message-ttl': maybe_s_to_ms(ttl if ttl is not None else conf.event_queue_ttl, ), 'x-expires': maybe_s_to_ms( expires if expires is not None else conf.event_queue_expires, ), })
def __init__( self, app, connection=None, exchange=None, exchange_type=None, persistent=None, serializer=None, auto_delete=True, **kwargs ): super(BaseRPCBackend, self).__init__(app, **kwargs) conf = self.app.conf self._connection = connection self._out_of_band = {} self.persistent = self.prepare_persistent(persistent) self.delivery_mode = 2 if self.persistent else 1 exchange = exchange or conf.result_exchange exchange_type = exchange_type or conf.result_exchange_type self.exchange = self._create_exchange(exchange, exchange_type, self.delivery_mode) self.serializer = serializer or conf.result_serializer self.auto_delete = auto_delete self.queue_arguments = dictfilter({"x-expires": maybe_s_to_ms(self.expires)}) self.result_consumer = self.ResultConsumer( self, self.app, self.accept, self._pending_results, self._pending_messages ) if register_after_fork is not None: register_after_fork(self, _on_after_fork_cleanup_backend)
def __init__(self, app, connection=None, exchange=None, exchange_type=None, persistent=None, serializer=None, auto_delete=True, **kwargs): deprecated.warn( 'The AMQP result backend', deprecation='4.0', removal='5.0', alternative='Please use RPC backend or a persistent backend.') super(AMQPBackend, self).__init__(app, **kwargs) conf = self.app.conf self._connection = connection self.persistent = self.prepare_persistent(persistent) self.delivery_mode = 2 if self.persistent else 1 exchange = exchange or conf.result_exchange exchange_type = exchange_type or conf.result_exchange_type self.exchange = self._create_exchange( exchange, exchange_type, self.delivery_mode, ) self.serializer = serializer or conf.result_serializer self.auto_delete = auto_delete self.queue_arguments = dictfilter({ 'x-expires': maybe_s_to_ms(self.expires), })
def __init__(self, app, connection=None, exchange=None, exchange_type=None, persistent=None, serializer=None, auto_delete=True, **kwargs): super(BaseRPCBackend, self).__init__(app, **kwargs) conf = self.app.conf self._connection = connection self._out_of_band = {} self.persistent = self.prepare_persistent(persistent) self.delivery_mode = 2 if self.persistent else 1 exchange = exchange or conf.result_exchange exchange_type = exchange_type or conf.result_exchange_type self.exchange = self._create_exchange( exchange, exchange_type, self.delivery_mode, ) self.serializer = serializer or conf.result_serializer self.auto_delete = auto_delete self.queue_arguments = dictfilter({ 'x-expires': maybe_s_to_ms(self.expires), }) self.result_consumer = self.ResultConsumer( self, self.app, self.accept, self._pending_results, self._pending_messages, ) if register_after_fork is not None: register_after_fork(self, _on_after_fork_cleanup_backend)