Plasma GitLab Archive
Projects Blog Knowledge

Class type Nethttpd_engine.http_engine_processing_config


class type http_engine_processing_config = object .. end

method config_synch_input : (Netchannels.in_obj_channel -> unit) -> Uq_engines.async_in_channel -> unit
The "input synchronizer": It is called as obj # config_synch_input f ch to create a synchronous input channel from an asynchronous one, ch. The function f must be called back by the synchronizer when synchronisation is established, and with the synchronous channel ch' as argument. In particular, the task of the synchronizer is to turn blocking reads of ch' into non-blocking reads of ch. In general there are two ways of implementation:
  • Buffer all input from ch until the end of the channel is reached, then call f with a wrapper channel ch' that just reads from the buffer.
  • Run f in a different thread that blocks whenever there is nothing to read from ch.
Both implementations are allowed, i.e. it is allowed that f runs in a different thread.

CHECK: How to handle exceptions raised from f? Idea: f is obliged to close ch' in this case, even if ch is not yet at the end. The rest of exception handling is up to the user. - The complementary must also be true: When there is an error in the engine, ch must be closed to signal the other thread that we have a problem.

method config_synch_output : (Netchannels.out_obj_channel -> unit) -> Uq_engines.async_out_channel -> unit
The "output synchronizer": It is called as obj # config_synch_output f ch to create a synchronous output channel from an asynchronous one, ch. The function f must be called back by the synchronizer when synchronisation is established, and with the synchronous channel ch' as argument. In particular, the task of the synchronizer is to turn blocking writes to ch' into non-blocking writes to ch. In general there are two ways of implementation:
  • Call f, then buffer all output to ch' until the end of the channel is reached, and finally output the contents of the buffer in an asynchronous way.
  • Run f in a different thread that blocks whenever there is no space to write to ch.
Both implementations are allowed, i.e. it is allowed that f runs in a different thread.

CHECK: Exceptions.

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