sig
module type Connection =
sig
type t
val create :
?do_logging:bool ->
extend_error:(Core.Std.Error.t -> unit) ->
extend_status:(string -> unit) ->
extend_execution:(Response.Execution.t -> unit) ->
extend_commission:(Response.Commission.t -> unit) ->
Async.Std.Reader.t ->
Async.Std.Writer.t -> Ib.Connection.t Async.Std.Deferred.t
val close : Ib.Connection.t -> unit Async.Std.Deferred.t
val closed : Ib.Connection.t -> unit Async.Std.Deferred.t
val is_closed : Ib.Connection.t -> bool
val set_server_log_level :
Ib.Connection.t ->
level:[ `Detail | `Error | `Information | `System | `Warning ] ->
unit
module Handshake_result :
sig
type t =
Eof
| Version_failure of int
| Server_header of [ `Version of int ] * Core.Std.Time.t *
Account_code.t
val t_of_sexp : Sexplib.Sexp.t -> Ib.Connection.Handshake_result.t
val sexp_of_t : Ib.Connection.Handshake_result.t -> Sexplib.Sexp.t
end
val try_connect :
Ib.Connection.t ->
client_version:int ->
client_id:Client_id.t ->
Ib.Connection.Handshake_result.t Core.Std.Or_error.t
Async.Std.Deferred.t
end
module Connection : Connection
module Header :
sig type 'a t val create : tag:'a -> version:int -> 'a Ib.Header.t end
module Request :
sig
type ('query, 'response) t
val create :
send_header:Send_tag.t Ib.Header.t ->
recv_header:Recv_tag.t Ib.Header.t ->
tws_query:'query Tws_prot.Pickler.t ->
tws_response:'response Tws_prot.Unpickler.t ->
('query, 'response) Ib.Request.t
val dispatch :
('query, 'response) Ib.Request.t ->
Ib.Connection.t ->
'query -> 'response Core.Std.Or_error.t Async.Std.Deferred.t
end
module Streaming_request :
sig
type ('query, 'response) t
module Id : Core.Std.Unique_id
val create :
?canc_header:Send_tag.t Ib.Header.t ->
?skip_header:Recv_tag.t Ib.Header.t list ->
send_header:Send_tag.t Ib.Header.t ->
recv_header:Recv_tag.t Ib.Header.t list ->
tws_query:'query Tws_prot.Pickler.t ->
tws_response:'response Tws_prot.Unpickler.t list ->
unit -> ('query, 'response) Ib.Streaming_request.t
val dispatch :
('query, 'response) Ib.Streaming_request.t ->
Ib.Connection.t ->
'query ->
('response Tws_result.t Async.Std.Pipe.Reader.t * Id.t)
Core.Std.Or_error.t Async.Std.Deferred.t
val cancel :
('a, 'b) Ib.Streaming_request.t -> Ib.Connection.t -> Id.t -> unit
end
module Streaming_request_without_id :
sig
type ('query, 'response) t
val create :
?skip_header:Recv_tag.t Ib.Header.t list ->
send_header:Send_tag.t Ib.Header.t ->
recv_header:Recv_tag.t Ib.Header.t list ->
tws_query:'query Tws_prot.Pickler.t ->
tws_response:'response Tws_prot.Unpickler.t list ->
unit -> ('query, 'response) Ib.Streaming_request_without_id.t
val dispatch :
('query, 'response) Ib.Streaming_request_without_id.t ->
Ib.Connection.t ->
'query ->
'response Async.Std.Pipe.Reader.t Core.Std.Or_error.t
Async.Std.Deferred.t
val cancel :
('a, 'b) Ib.Streaming_request_without_id.t -> Ib.Connection.t -> unit
end
end