I'm stuck on how to proceed. I'm trying to use the play 1.2.5 framework with a 3rd party API (Interactive Brokers).
I know someone answered a similar question for Grails Java : How to achieve socket programming functionality with 3rd party API
basically, IB API uses asynchronous communication for requests and replies. i.e. when i call getData(), the API knows to use the callback function dataResults() when it is ready to send them. In order for dataResults() to be callable, the broker object I created still needs to be around to receive the reply. Inside a controller function, if i create a broker object and call getData(), when the request finishes, the broker object obviously also disappears. So I'll never be able to receive the reply.
any ideals on how to do this in Play? any help would be much appreciated.
thanks