package current
Install
dune-project
Dependency
Authors
-
TThomas Leonard <talex5@gmail.com>
-
AAntonin Décimo <antonin@tarides.com>
-
TTim McGilchrist <timmcgil@gmail.com>
-
CCraig Ferguson <me@craigfe.io>
-
EEtienne MARAIS <etienne@maiste.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
David Allsopp
-
EEwan Mellor <ewan@tarides.com>
-
KKate <kit.ty.kate@disroot.org>
-
MMark Elvers <mark.elvers@tunbury.org>
-
PPuneeth Chaganti <punchagan@muse-amuse.in>
-
LLucas Pluvinage <lucas@tarides.com>
-
NNavin Keswani <navin@novemberkilo.com>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
Patrick Ferris
-
AArthur Wendling <art.wendling@gmail.com>
-
AAnurag Soni <anurag@sonianurag.com>
-
AAmbre Austen Suhamy <ambre@tarides.com>
-
BBen Andrew <benmandrew@gmail.com>
-
GGargi Sharma <gs051095@gmail.com>
-
JJonathan Coates <git@squiddev.cc>
-
JJules Aguillon <juloo.dsi@gmail.com>
-
MMagnus Skjegstad <magnus@skjegstad.com>
-
SShon Feder <shon.feder@gmail.com>
-
Ssmolck <46855713+smolck@users.noreply.github.com>
-
Ttatchi <corentin.leruth@gmail.com>
Maintainers
Sources
md5=7cc6b5cb4158e01444c92082fc7fc88d
sha512=5576b26377d470bdd4cbdb58d4cc4bcc3b62258ed9768b589bcae09f16919d7748d93cac34f35b6da20972dde356f57eadc00ef832f7cb939a42ce0689fc4104
doc/current/Current/Monitor/index.html
Module Current.MonitorSource
A monitor is an input pipeline stage that can watch for external events.
An 'a t is a monitor that outputs values of type 'a.
val create :
read:(unit -> 'a or_error Lwt.t) ->
watch:((unit -> unit) -> (unit -> unit Lwt.t) Lwt.t) ->
pp:(Format.formatter -> unit) ->
'a tcreate ~read ~watch ~pp is a monitor that uses read to read the current value of some external resource and watch to watch for changes. When the monitor is needed, it first calls watch refresh to start watching the resource. When this completes, it uses read () to read the current value. Whenever the watch thread calls refresh it marks the value as being out-of-date and will call read to get a new value. When the monitor is no longer required, it will call the shutdown function returned by watch to stop watching the resource. If it is needed later, it will run watch to start watching it again. This function takes care to perform only one user action (installing the watch, reading the value, or turning off the watch) at a time. For example, if refresh is called while already reading a value then it will wait for the current read to complete and then perform a second one.
get t enables t and returns the primitive for it. When the primitive is released, the monitor will be disabled. Call this in your let> block.