Skip to content

Commit

Permalink
Tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jun 5, 2023
1 parent 812b1e7 commit be75574
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Equinox.Core/AsyncBatchingGate.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ type internal AsyncBatch<'Req, 'Res>() =
type AsyncBatchingGate<'Req, 'Res>(dispatch: Func<'Req[], CancellationToken, Task<'Res[]>>, [<O; D null>]?linger: TimeSpan) =
let lingerMs = match linger with None -> 1 | Some x -> int x.TotalMilliseconds
let mutable cell = AsyncBatch<'Req, 'Res>()
new (dispatch: 'Req[] -> Async<'Res[]>, ?linger) = AsyncBatchingGate((fun reqs ct -> Async.startImmediateAsTask ct (dispatch reqs)), ?linger = linger)

new (dispatch: 'Req[] -> Async<'Res[]>, ?linger) = AsyncBatchingGate((fun reqs ct -> dispatch reqs |> Async.startImmediateAsTask ct), ?linger = linger)

/// Include an item in the batch; await the collective dispatch (subject to the configured linger time)
member x.ExecuteAsync(req, ct) = task {
Expand Down

0 comments on commit be75574

Please sign in to comment.