7 The stream_pool library
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • The stream_pool library
          • add_stream_to_pool/2
          • delete_stream_from_pool/1
          • close_stream_pool/0
          • dispatch_stream_pool/1
          • stream_pool_main_loop/0
Availability::- use_module(library(streampool)).(can be autoloaded)
Sourcedispatch_stream_pool(+TimeOut)
Wait for maximum of TimeOut for input on any of the streams in the pool. If there is input, call the Goal associated with add_stream_to_pool/2. If Goal fails or raises an exception a message is printed. TimeOut is described with wait_for_input/3.

If Goal is called, there is some input on the associated stream. Goal must be careful not to block as this will block the entire pool.2This is hard to achieve at the moment as none of the Prolog read-commands provide for a timeout.