Пример #1
0
        private async Task <TimeSpan> GetNextEvent(OperationTaskflow flow)
        {
            var operationStatus = await connection.GetOperationStatus(flow.Task);

            if (operationStatus.Events != null)
            {
                foreach (var operationEvent in operationStatus.Events)
                {
                    callback(operationEvent);
                }
            }

            return(operationStatus.RetryAfter);
        }
Пример #2
0
        public OperationMonitor(
            OperationTaskflow flow,
            TimeSpan timeoutAcknowledge,
            TimeSpan timeoutComplete,
            IConnection connection,
            Action <OperationEvent> callback)
        {
            this.flow          = flow;
            this.callback      = callback;
            this.connection    = connection;
            TimeoutAcknowledge = timeoutAcknowledge;
            TimeoutComplete    = timeoutComplete;

            Monitor();
        }