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=cd79d2a2c03fc2a548458edc92a49601
sha512=c1ee24c27b2fdc01a34a0ea041e3c5bf1fef21997dd0a12d54138c9fac2992c68b9f1dd823d8fddfc3272df793585af9f16f94ae262c149e72cd2a3ddcdf03f7
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.