示例#1
0
            public async Task <string> ConsumeTwoAsync(CancellationToken token)
            {
                CarrierPigeonResponse r1 = await this.QuickDeliveryAsync(token);

                CarrierPigeonResponse r2 = await this.QuickDeliveryAsync(token);

                // does not handle falted tasks
                // return a string so it's easy rather than a tuple or custom object
                return
                    ("================================================================================\n" +
                     FormatResponse(r1) + '\n' +
                     FormatResponse(r2) + '\n' +
                     "================================================================================\n");
            }
示例#2
0
 private static string FormatResponse(CarrierPigeonResponse resp) =>
 FormatResponse(resp.GetType().Name, resp.Code.ToString(), resp.Detail);