protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer) { try { await consumer.HandleBasicDeliver(_consumerTag, _deliveryTag, _redelivered, _exchange, _routingKey, _basicProperties, _body.Memory.Slice(0, _bodyLength)).ConfigureAwait(false); } catch (Exception e) { var details = new Dictionary <string, object>() { { "consumer", consumer }, { "context", "HandleBasicDeliver" } }; model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details)); } finally { _body.Dispose(); } }
protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer) { try { await consumer.HandleBasicDeliver(_consumerTag, _deliveryTag, _redelivered, _exchange, _routingKey, _basicProperties, _body).ConfigureAwait(false); } catch (Exception e) { var details = new Dictionary <string, object>() { { "consumer", consumer }, { "context", "HandleBasicDeliver" } }; model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details)); } finally { if (MemoryMarshal.TryGetArray(_body, out ArraySegment <byte> segment)) { ArrayPool <byte> .Shared.Return(segment.Array); } } }
protected override Task Execute(IAsyncBasicConsumer consumer) { return(consumer.HandleBasicDeliver(_consumerTag, _deliveryTag, _redelivered, _exchange, _routingKey, _basicProperties, _body)); }
protected override async Task Execute(ModelBase model, IAsyncBasicConsumer consumer) { try { await consumer.HandleBasicDeliver(consumerTag, deliveryTag, redelivered, exchange, routingKey, basicProperties, body).ConfigureAwait(false); } catch (Exception e) { var details = new Dictionary <string, object>() { { "consumer", consumer }, { "context", "HandleBasicDeliver" } }; model.OnCallbackException(CallbackExceptionEventArgs.Build(e, details)); } }