alex314159 / ib-re-actor-976-plus

A clojure friendly wrapper for the Interactive Brokers java API.
23 stars 3 forks source link

Gateway / synchronous functions don't work? #2

Open pjlegato opened 4 years ago

pjlegato commented 4 years ago

The gateway and synchronous functions seem to only pass nil messages to the handler functions (though the default println handler does print the actual reply message to stdout, so connectivity is working.)

None of the examples seem to use them. Are they deprecated?

For example:

(defonce connection (gateway/connect 2 "localhost" default-paper-port println))

(class (ib-re-actor-976-plus.synchronous/server-time connection))
;; =>  nil
;; though println does render the time message to stdout

(def print-handlers
         {:data #(println "Received:" %)
          :end #(println "End of the request.")
          :error #(println "Error: " %)})

(gateway/request-current-time connection print-handlers)
;; =>
;; Received: nil
;; End of the request.
;;
;; println does print the full reply message to stdout
alex314159 commented 4 years ago

Thanks Paul. I'm not using the synchronous part so could well be really broken - would welcome PR