Пример #1
0
        public InMemoryOutboxConsumeContext(ConsumeContext context)
            : base(context)
        {
            _context = context;

            ReceiveContext = new InMemoryOutboxReceiveContext(this, context.ReceiveContext);

            _pendingActions = new List <Func <Task> >();
            _clearToSend    = new TaskCompletionSource <InMemoryOutboxConsumeContext>();
        }
Пример #2
0
        public InMemoryOutboxConsumeContext(ConsumeContext context)
            : base(context)
        {
            ReceiveContext = new InMemoryOutboxReceiveContext(this, context.ReceiveContext);

            _pendingActions = new List <Func <Task> >();
            _clearToSend    = TaskUtil.GetTask <InMemoryOutboxConsumeContext>();

            if (context.TryGetPayload(out MessageSchedulerContext schedulerContext))
            {
                _outboxSchedulerContext = new InMemoryOutboxMessageSchedulerContext(schedulerContext);
                context.AddOrUpdatePayload(() => _outboxSchedulerContext, _ => _outboxSchedulerContext);
            }
        }