The demultiplexer must allow you specify that you would like to receive notification of some sort of events (system generated, based on your operations), and provide a way of delivering these notifications to you.
In Giallo, the proactor and reactor classes model the demultiplexer concept and provide a common interface to several different demultiplexer implementations.
Objects on which events should be demultiplexed are described to the
demultiplexer using the
class. An instance of the
type, configured to contain a completion
function, and the descriptor of the object to demultiplex, is passed
to the demultiplexer in an _proactoradd function. Any completion
information is stored in the
before the completion routine
is implemented as a metafunction,
which takes the demultiplexer, a tag for the type of object being
demultiplexed, and the role that object is playing.
How should demux.run() behave when there are no events registered with the demultiplexer? block or exit.
|Copyright © 2004 Hugo Duncan|