Example #1
0
        public async Task Send(object command, bool requireFeedback = false, bool requireHandled = false)
        {
            try
            {
                var transport = new CommandTransportMessage()
                {
                    Payload = command,
                    RequiresHandledFeedback  = requireHandled,
                    RequiresReceivedFeedback = requireFeedback
                };

                if (requireFeedback || requireHandled)
                {
                    _devliverables.Add(transport.MessageId, new DeliveryKeeper(command, requireFeedback, requireHandled));
                }

                await _transport.WriteCommandAsync(transport);
            }
            catch (IOException)
            {
                Dispose();
            }
        }