private async Task OnSagaProcessingStart(ExecutionStartMessage msg)
        {
            ISagaLocking sagaLocking = serviceProvider.GetRequiredService <ISagaLocking>();

            if (!await sagaLocking.Acquire(msg.SagaID))
            {
                throw new SagaIsBusyException(msg.SagaID);
            }
        }
Exemplo n.º 2
0
        private async Task OnSagaProcessingStart(ExecutionStartMessage msg)
        {
            ISagaLocking sagaLocking = serviceProvider.GetRequiredService <ISagaLocking>();
            var          id          = msg?.Saga?.Data?.ID;

            if (id == null)
            {
                return;
            }

            if (!await sagaLocking.Acquire(id.Value))
            {
                throw new SagaIsBusyException(id.Value);
            }
        }