Esempio n. 1
0
        protected async Task <TResult> ExecuteCommandAsync <TData, TResult>(string name, TData data = default, TimeSpan?timeout = null)
        {
            var command  = MessageFactory.CreateCommand(name, data);
            var response = await QuikClient.SendAsync <IResult <TResult> >(command, timeout).ConfigureAwait(false);

            return(response.Data);
        }
Esempio n. 2
0
        /// <inheritdoc/>
        public async Task <string> PingAsync()
        {
            // could have used StringMessage directly. This is an example of how to define DTOs for custom commands
            var command = new PingRequest();
            var result  = await QuikClient.SendAsync <PingResponse>(command).ConfigureAwait(false);

            Trace.Assert(result.Data == "Pong");
            return(result.Data);
        }