Exemplo n.º 1
0
 private async Task <IPOS> GetPOSAsync()
 {
     if (FindViewById <RadioButton>(Resource.Id.radioGrpc).Checked)
     {
         return(await GrpcPosFactory.CreatePosAsync(new GrpcClientOptions
         {
             Url = new Uri(QUEUE_URL_GRPC)
         }));
     }
     else
     {
         return(await HttpPosFactory.CreatePosAsync(new HttpPosClientOptions
         {
             Url = new Uri(QUEUE_URL_REST)
         }));
     }
 }
Exemplo n.º 2
0
        public static async Task RunAsync(string url, Guid cashboxId, string receiptExampleDirectory)
        {
            _cashBoxId = cashboxId;
            var retryOptions = new RetryPolicyOptions {
                ClientTimeout = TimeSpan.FromSeconds(90), DelayBetweenRetries = TimeSpan.FromSeconds(5), Retries = 3
            };

            _pos = await GrpcPosFactory.CreatePosAsync(new GrpcClientOptions { Url = new Uri(url), RetryPolicyOptions = retryOptions });

            _examples = LoadExamples(receiptExampleDirectory, cashboxId);

            await ExecuteEchoAsync("Test");

            while (true)
            {
                await MenuAsync();
            }
        }
Exemplo n.º 3
0
 protected override ifPOS.v1.IPOS CreateClient() => GrpcPosFactory.CreatePosAsync(new GrpcPosOptions {
     Url = new Uri($"http://{_host}:{_port}")
 }).Result;