Commit 86a03328 authored by alan.f's avatar alan.f

update-code-for-async

parent 9ed82e73
...@@ -33,19 +33,17 @@ namespace C_UI ...@@ -33,19 +33,17 @@ namespace C_UI
request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{fileName}"); request.OnResponseReceived += (req, response) => logger.Info($"{response.Status}-{fileName}");
await client.AddRequestAsync(request); await client.AddRequestAsync(request);
await client.SendAsync(); await client.SendAsync();
return fileName;
}) })
.Select(t => .Select(t => t.Wait(1))
.Subscribe(filename =>
{ {
return t.Result; logger.Warn($"file sent:{filename}");
}).Subscribe(); },
//.Subscribe(filename => onError =>
//{ {
// logger.Warn($"file sent:{filename}"); logger.Error(onError.Message);
//}, },
//onError => () => { });
//{ logger.Error(onError.Message); },
//() => { });
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment