diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-05 17:50:14 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-05 17:50:14 +0200 |
| commit | 40ab3cf70594a0b77592879e9bcae84823c5e1f2 (patch) | |
| tree | 470158a9b48b300f65bc1244f087dc01bc345417 /Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs | |
| parent | e66f1bad3aad6de7f63aa9c277b87d8416c08488 (diff) | |
| download | Tango-40ab3cf70594a0b77592879e9bcae84823c5e1f2.tar.gz Tango-40ab3cf70594a0b77592879e9bcae84823c5e1f2.zip | |
Implemented timeout for continuous response. (at least one response).
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs index fd20f9f5d..1ae4c078a 100644 --- a/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operators/MachineOperator.cs @@ -133,8 +133,15 @@ namespace Tango.Integration.Operators handler = new JobHandler(async () => { - var result = await SendRequest<AbortJobRequest, AbortJobResponse>(new AbortJobRequest(), TimeSpan.FromSeconds(10)); - handler.RaiseCanceled(); + try + { + var result = await SendRequest<AbortJobRequest, AbortJobResponse>(new AbortJobRequest()); + handler.RaiseCanceled(); + } + catch (Exception) + { + //TODO: What to do in case job failed to cancel ?? + } }); SendContinuousRequest<JobRequest, JobResponse>(request).Subscribe((response) => @@ -142,7 +149,10 @@ namespace Tango.Integration.Operators handler.RaiseStatusReceived(response.Message.Status); },(ex) => { - handler.RaiseFailed(ex); + if (!handler.IsCanceled) + { + handler.RaiseFailed(ex); + } },() => { handler.RaiseCompleted(); |
