package devkit
Development kit - general purpose library
Install
Dune Dependency
Authors
Maintainers
Sources
devkit-1.20210517.tbz
md5=00995ebead339d6ec1ba7859c3fc3a58
sha256=5ad39c7fa1a966a2f0a7f6dbb7e82c787439c73482f5f44b3c9fb54b040d36eb
sha512=8dd3f7d4aaabae9aa9ede13edee2b22214c0d2e2780bb08b2ca8ed588d74fc6d9b1908bb31dfee49c949c7cc425fb98897b8e0f11280070ebd99b965908ea133
doc/devkit.core/Devkit_core/Async/index.html
Module Devkit_core.Async
Source
Asynchronous IO helpers
Source
val simple_event :
Ev.event_base ->
?ev:Ev.event ->
?timeout:float ->
Unix.file_descr ->
Ev.event_flags list ->
(Ev.event -> Unix.file_descr -> Ev.event_flags -> unit) ->
Ev.event
Create a new event or use the provided ev
and make it persistent with the infinite timeout (or use the provided timeout
). Schedule this event with provided callback f
. Don't forget del
to unschedule.
Source
val setup_simple_event :
Ev.event_base ->
?ev:Ev.event ->
?timeout:float ->
Unix.file_descr ->
Ev.event_flags list ->
(Ev.event -> Unix.file_descr -> Ev.event_flags -> unit) ->
unit
Source
val read_available :
limit:int ->
Unix.file_descr ->
[> `Chunk of string * bool | `Limit of string ]
Read out all immediately available input (no blocking)
Source
val read_buf :
Ev.event_base ->
?ev:Ev.event ->
?timeout:float ->
bytes ->
Unix.file_descr ->
([> `Eof | `EofImm | `Exn of exn | `ExnImm of exn | `Timeout ] ->
int ->
unit) ->
(bytes -> unit) ->
unit
read_buf buf fd err k
- asynchronously fill buf
with data from fd
and call k buf
when done (buffer is full). fd
should be nonblocking. Call err
on error (EOF).
Source
val read_n :
Ev.event_base ->
?ev:Ev.event ->
?timeout:float ->
int ->
Unix.file_descr ->
([> `Eof | `EofImm | `Exn of exn | `ExnImm of exn | `Timeout ] ->
int ->
unit) ->
(string -> unit) ->
unit
Source
val periodic_timer_0 :
Ev.event_base ->
bool ref ->
float ->
float ->
?name:string ->
(unit -> unit) ->
Ev.event
Call f
with delay
-second pauses between invocations. Set stop
to true
to stop the timer. NB do not Ev.del
the event inside the f
callback.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>