none
BrokerClient.GetResponses never returns when the job is submitted from a WPF application RRS feed

  • Question

  • In diagnosing this problem in a real app, I was able to recreate it using the HelloWorldR2 console sample project, which is working perfectly.

    I basically added a new WPF project to the HelloWorldR2 solution, added a single button to the main form, and copy-pasted the code from the main method of the HelloWorldR2 console app sample. When I run this app and  click the button, the cluster gets the job and runs it, but the client never receives any responses, and just sits there, blocked at the GetResponses call.

    What could be going on here? Can anyone else confirm this behaviour? 

    Tuesday, September 6, 2011 5:21 PM

Answers

  • Hi wbradney,

    You cannot call GetResponses from UI thread. There're two ways you can do:
    1. use response handler instead
    2. call getresponse from other thread than main GUI thread.

    • Marked as answer by wbradney Wednesday, September 7, 2011 3:40 PM
    Wednesday, September 7, 2011 3:13 AM

All replies

  • Same thing with a WinForms app.

    If I run the service call/response gather on a thread pool thread it works as expected. I guess you can't run BrokerClient on a UI thread?

    Tuesday, September 6, 2011 5:39 PM
  • Hi wbradney,

    You cannot call GetResponses from UI thread. There're two ways you can do:
    1. use response handler instead
    2. call getresponse from other thread than main GUI thread.

    • Marked as answer by wbradney Wednesday, September 7, 2011 3:40 PM
    Wednesday, September 7, 2011 3:13 AM
  • Thanks for the confirmation. In that case it might be nice in a future release to find a way to have GetResponses immediately throw if it detects this condition, rather than wait forever.
    • Edited by wbradney Wednesday, September 7, 2011 3:55 PM
    Wednesday, September 7, 2011 3:53 PM