Skip to content

Commit d4f0563

Browse files
committed
multi: send_txn returns Deferred.t instead of Ivar.t
Returning an Ivar.t gives the user the ability to fill it with a value. Returning a Deferred.t on the other hand does not.
1 parent 63733cf commit d4f0563

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

async/Async_OpenFlow.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ module Chunk : sig
175175
: t
176176
-> Client_id.t
177177
-> m
178-
-> [ `Sent of Message.t Ivar.t | `Drop of exn ] Deferred.t
178+
-> [ `Sent of Message.t Deferred.t | `Drop of exn ] Deferred.t
179179

180180
val handshake : int -> (t, e, h) Stage.t
181181
end

async/Async_OpenFlow0x01.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ module Controller = struct
103103
try begin
104104
send_txn t sw_id msg
105105
>>= function
106-
| `Sent ivar -> Ivar.read ivar >>| f
107-
| `Drop exn -> return (Result.Error exn)
106+
| `Sent def -> def >>| f
107+
| `Drop exn -> return (Result.Error exn)
108108
end with Not_found -> return (Result.Error Not_found)
109109

110110
let send_ignore_errors t sw_id msg =

async/Async_OpenFlow0x04.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ module Controller = struct
138138
try begin
139139
send_txn t sw_id msg
140140
>>= function
141-
| `Sent ivar -> Ivar.read ivar >>| f
142-
| `Drop exn -> return (Result.Error exn)
141+
| `Sent def -> def >>| f
142+
| `Drop exn -> return (Result.Error exn)
143143
end with Not_found -> return (Result.Error Not_found)
144144

145145
let send_ignore_errors t sw_id msg =

async/Async_OpenFlowChunk.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ module Controller = struct
257257
let ivar = Conn.add_txn conn m in
258258
send t c_id m
259259
>>| function
260-
| `Sent _ -> `Sent ivar
260+
| `Sent _ -> `Sent (Ivar.read ivar)
261261
| `Drop exn ->
262262
Conn.remove_txn conn m;
263263
`Drop exn

0 commit comments

Comments
 (0)