PreviousUpNext

15.3.806  src/lib/x-kit/xclient/src/wire/xsequencer-ximp.api

## xsequencer-ximp.api
#
# For the big picture see the imp dataflow diagrams in
#
#     src/lib/x-kit/xclient/src/window/xclient-ximps.pkg
#
# Use protocol is:
#
# Next up is parameter support for:
#    error_sink
#    to_x_sink
#    from_x_mailqueue
#
#   {   (make_run_gun  ())   ->   { run_gun',  fire_run_gun  };
#       (make_end_gun ())   ->   { end_gun', fire_end_gun };
#
#       sx_state = sx::make_xsequencer_ximp_state ();
#       sx_ports = sx::make_xsequencer_ximp "Some name";
#       sx       = sx_ports.clientport;                                                         # The clientport represents the imp for most purposes.
#
#       ...                                                                                     # Create other app imps.
#
#       sx::configure_sequencer_imp
#         (sxports.configstate, sx_state, { ... }, run_gun', end_gun' );                                # Wire imp to other imps.
#                                                                                               # All imps will start when run_gun' fires.
#
#       ...                                                                                     # Wire up other app imps similarly.
#
#       fire_run_gun ();                                                                        # Start all app imps running.
#
#       sx.send_xrequest(...);                                                                  # Many calls like this over lifetime of imp.
#       ...                                                                                     # Similar calls to other app imps.
#
#       fire_end_gun ();                                                                        # Shut the imp down cleanly.
#   };

# Compiled by:
#     src/lib/x-kit/xclient/xclient-internals.sublib



stipulate
    include package   threadkit;                                                                # threadkit                                     is from   src/lib/src/lib/thread-kit/src/core-thread-kit/threadkit.pkg
    #
    package op  =  xsequencer_to_outbuf;                                                        # xsequencer_to_outbuf                          is from   src/lib/x-kit/xclient/src/wire/xsequencer-to-outbuf.pkg
    package x2s =  xclient_to_sequencer;                                                        # xclient_to_sequencer                          is from   src/lib/x-kit/xclient/src/wire/xclient-to-sequencer.pkg
    package xew =  xerror_well;                                                                 # xerror_well                                   is from   src/lib/x-kit/xclient/src/wire/xerror-well.pkg
    package xps =  xpacket_sink;                                                                # xpacket_sink                                  is from   src/lib/x-kit/xclient/src/wire/xpacket-sink.pkg
herein


    # This api is implemented in:
    #
    #     src/lib/x-kit/xclient/src/wire/xsequencer-ximp.pkg
    #
    api Xsequencer_Ximp
    {
        Exports   = {                                                                           # Ports we export for use by other imps.
                      xpacket_sink:             xps::Xpacket_Sink,                              # For xpackets from xserver via inbuf.
                      xclient_to_sequencer:     x2s::Xclient_To_Sequencer,                      # Requests from widget/application code.
                      xerror_well:              xew::Xerror_Well                                # Error messages from the X server.
                    };

        Imports   = {                                                                           # Ports we use which are exported by other imps.
                      xsequencer_to_outbuf:     op::Xsequencer_To_Outbuf,
                      xpacket_sink:             xps::Xpacket_Sink                               # Forwards xmsgs to decode_xpackets_ximp from   src/lib/x-kit/xclient/src/wire/decode-xpackets-ximp.pkg
                    };

        Option = MICROTHREAD_NAME String;                                                       # 

        Xsequencer_Egg =  Void -> (Exports,   (Imports, Run_Gun, End_Gun) -> Void);

        make_xsequencer_egg:    List(Option) -> Xsequencer_Egg;
    };                                                                                          # api Xsequencer_Ximp
end;




Comments and suggestions to: bugs@mythryl.org

PreviousUpNext