Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunSynchronously exception on RESTActionConsumer.cs #43

Merged
merged 4 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions AsterNET.ARI/ARIClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void Dispose()

#region Private and Protected Methods


private void _eventProducer_OnConnectionStateChanged(object sender, EventArgs e)
{
if (_eventProducer.State != ConnectionState.Open)
Expand Down Expand Up @@ -153,10 +154,10 @@ private void _eventProducer_OnMessageReceived(object sender, MessageEventArgs e)
{
FireEvent(evnt.Type, evnt, this);
}
catch
catch(Exception ex)
{
// Handle any exceptions that were thrown by the invoked event handler
Console.WriteLine("An event listener went kaboom!");
Console.WriteLine("The event listener " + evnt.Type.ToString() + " cause an exeption: " + ex.Message );
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions AsterNET.ARI/Middleware/Default/RESTActionConsumer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public IRestCommand GetRestCommand(HttpMethod method, string path)
{
var cmd = (Command) command;
var result = cmd.Client.Execute<T>(cmd.Request);
result.RunSynchronously();

//result.RunSynchronously();
result.GetAwaiter().GetResult();
var rtn = new CommandResult<T> {StatusCode = result.Result.StatusCode, Data = result.Result.Data};

return rtn;
Expand All @@ -36,8 +36,8 @@ public IRestCommandResult ProcessRestCommand(IRestCommand command)
{
var cmd = (Command) command;
var result = cmd.Client.Execute(cmd.Request);
result.RunSynchronously();

//result.RunSynchronously();
result.GetAwaiter().GetResult();
var rtn = new CommandResult {StatusCode = result.Result.StatusCode, RawData = result.Result.RawBytes};

return rtn;
Expand Down