feat: add Event.of_fut

This commit is contained in:
Simon Cruanes 2024-09-03 09:19:39 -04:00
parent 8582f6f3bb
commit ec5ac645de
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
3 changed files with 10 additions and 1 deletions

4
src/sync/event.ml Normal file
View file

@ -0,0 +1,4 @@
include Picos_std_event.Event
let[@inline] of_fut (fut : _ Moonpool.Fut.t) : _ t =
from_computation (Moonpool.Fut.Private_.as_computation fut)

5
src/sync/event.mli Normal file
View file

@ -0,0 +1,5 @@
include module type of struct
include Picos_std_event.Event
end
val of_fut : 'a Moonpool.Fut.t -> 'a t

View file

@ -1,7 +1,7 @@
module Mutex = Picos_std_sync.Mutex module Mutex = Picos_std_sync.Mutex
module Condition = Picos_std_sync.Condition module Condition = Picos_std_sync.Condition
module Lock = Lock module Lock = Lock
module Event = Picos_std_event module Event = Event
module Semaphore = Picos_std_sync.Semaphore module Semaphore = Picos_std_sync.Semaphore
module Lazy = Picos_std_sync.Lazy module Lazy = Picos_std_sync.Lazy
module Latch = Picos_std_sync.Latch module Latch = Picos_std_sync.Latch