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

update-code-for-async

parent 9ed82e73
...@@ -27,25 +27,23 @@ namespace C_UI ...@@ -27,25 +27,23 @@ namespace C_UI
client.NegotiateAsyncOps(); client.NegotiateAsyncOps();
inputsDto.FileNames.ToObservable() inputsDto.FileNames.ToObservable()
.Select(async fileName => .Select(async fileName =>
{ {
var request = new DicomCStoreRequest(fileName); var request = new DicomCStoreRequest(fileName);
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 => t.Wait(1))
.Select(t => .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