package vchan

  1. Overview
  2. Docs

Module Vchan.In_memory_eventsSource

include S.EVENTS
Sourcetype port

an identifier for a source of events. Ports are allocated by calls to listen, then exchanged out-of-band (typically by xenstore) and finally calls to connect creates a channel between the two domains. Events are send and received over these channels.

Sourceval port_of_string : string -> (port, [> `Msg of string ]) result
Sourceval string_of_port : port -> string
Sourcetype channel

a channel is the connection between two domains and is used to send and receive events.

Sourcetype event

an event notification received from a remote domain. Events contain no data and may be coalesced. Domains which are blocked will be woken up by an event.

Sourceval initial : event

represents an event which 'fired' when the program started

Sourceval recv : channel -> event -> event Lwt.t

recv channel event blocks until the system receives an event newer than event on channel channel. If an event is received while we aren't looking then this will be remembered and the next call to after will immediately unblock. If the system is suspended and then resumed, all event channel bindings are invalidated and this function will fail with Generation.Invalid

Sourceval send : channel -> unit

send channel sends an event along channel, to another domain which will be woken up

Sourceval listen : int -> port * channel

listen domid allocates a fresh port and event channel. The port may be supplied to connect

Sourceval connect : int -> port -> channel

connect domid port connects an event channel to port on domid

Sourceval close : channel -> unit

close channel closes this side of an event channel

Sourceval assert_cleaned_up : unit -> unit

Throws a Failure if there are any resources still in use. This is intended to be used by test cases to check everything has been properly closed.

OCaml

Innovation. Community. Security.