Process Channels
Author(s): Jose F. Morales.
This module provides an abstraction for communication channels between processes (process) based on standard input/output/error streams.
Usage and interface
- Library usage:
:- use_module(library(process/process_channel)). - Exports:
- Predicates:
channel_bindings/2, cleanup_binding/1, binding_port_call/1, send_input/2, receive_output/2, open_redirect/3, close_redirect/2. - Regular Types:
process_channel/1.
- Predicates:
- Imports:
- System library modules:
lists, port_reify, system, read, write, strings, file_utils. - Packages:
prelude, nonpure, condcomp, assertions, regtypes, isomodes, hiord, dcg.
- System library modules:
Documentation on exports
Usage:process_channel(Channel)
A communication channel for standard file descriptors
Usage:channel_bindings(Channels,ChannelBinds)
Create channel bindings (taking into account pipes)
Usage:cleanup_binding(ChannelB)
Cleanup temporaries due to channel file-based bindings.
Usage:binding_port_call(ChannelB)
Do port_call/1 on the result of channel transfer (send or receive).
Usage:send_input(Mode,ChannelBinding)
Send input through channel binding ChannelBinding. Transfer status is internally stored (see binding_port_call/1).
Usage:receive_output(Mode,ChannelBinding)
Receive output from channel binding ChannelBinding. Transfer status is internally stored (see binding_port_call/1).
Usage:open_redirect(ChannelB,Mode,S)
Open stream file redirections (for internals:'$exec'/9).
Usage:close_redirect(ChannelB,S)
Close stream file redirections (for internals:'$exec'/9).
Known bugs and planned improvements
- (feature) Generalize channel marshalling
- (feature) Asynchronous data transfer is not really asynchronous