Plasma GitLab Archive
Projects Blog Knowledge

Class Uq_engines.output_async_descr

class output_async_descr : dst:Unix.file_descr -> ?buffer_size:int -> ?close_dst:bool -> Unixqueue.event_system -> async_out_channel_engine
This engine implements an async_out_channel for the output descriptor dst. The engine provides an internal buffer to reduce the number of blocked output operations; by default there is even no limit for the growth of the buffer, and because of this the channel never blocks (can_output is always true).

The engine attaches immediately to the event system, and detaches automatically. By default, the file descriptor is closed when the engine stops operation, either successfully or because of an error.

If the buffer is full, the class accepts no more data until there is again free space in the buffer. This means that writers must be prepared that can_output returns false, and that the output method returns 0. The buffer can only get "full" if the buffer_size argument is passed.

The notification mechanism is shared by the "engine nature" and by the "channel nature" of this class: If either the state or can_output change their values, the notification callbacks are invoked.

The semantics of the engine is undefined if dst is not a stream-oriented descriptor.

TODO: This class cannot yet cope with Win32 named piped.

buffer_size : Limits the size of the buffer
close_dst : Whether to close dst when the engine stops (default: true)

This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml