piping
A Common Lisp library to enable simple message pipelines.
See about.html for documentation, examples and package index.
A library to enable simple message pipelines.
A Common Lisp library to enable simple message pipelines.
See about.html for documentation, examples and package index.
FAUCET
Base faucet class.
FILTER
Base filter class.
PIPELINE
Base pipeline object that is necessary to orchestrate piping systems.
PREDICATE-FILTER
Segment that predicate-filters messages according to a predicate function.
PRINTER
Segment that prints each message it receives.
SEGMENT
Base segment class.
SWITCH
A switch that only passes to the pipe as set by its current value.
(
NAMES
OBJECT
)
(
PIPE
OBJECT
)
(
PIPELINE
OBJECT
)
(
PREDICATE
OBJECT
)
(
PRINT-STREAM
OBJECT
)
(
VALUE
OBJECT
)
(
MAKE-PIPE
)
Creates a new splitter array.
(
ADD-SEGMENT
PIPELINE SEGMENT &OPTIONAL PLACE
)
Add a new segment to the pipeline. If place is set, the pipe is added to the specified place as per INSERT. The place specified is expected to be a splitter or similar to append the pipe to. Returns the segment.
(
FIND-PARENT
SEGMENT PLACE
)
Same as FIND-PLACE, except it returns the parent of the matched item. As secondary value it returns the position of the matched item within the parent.
(
FIND-PLACE
SEGMENT PLACE
)
Searches and returns the segment as designated by PLACE. A place is a list of signed integers, each denoting the position of the item within the current splitter or segment. Subsequent numbers descend into the item matched by the previous number. As such, (1 4) matches the following: ([] () [] []) - ([] [] [] [] [] []) ^^
(
INSERT
SEGMENT PLACE &OPTIONAL POSITION
)
Appends the item to the given place unless a specific position is given. If position is set, the item is expected to be inserted at the specified position, without replacing or disturbing any other items. Returns the segment. Do note that using insert directly can affect names and make them invalid or point to unexpected segments. You should always use add-segment or insert-segment instead if possible.
(
INSERT-SEGMENT
PIPELINE SEGMENT PLACE
)
Insert the segment at the given place. Note that the segment is always inserted into the parent as specified by the place and found by FIND-PARENT and inserted into the position as per INSERT. Returns the segment.
(
MOVE-SEGMENT
PIPELINE PLACE NEW-PLACE
)
Moves a segment to another while preserving names. This attempts to fix names associated with the place or deeper places by changing their place as well. Returns the segment.
(
PASS
SEGMENT MESSAGE
)
Pass a message through a segment. Note for implementors of this method for custom segments: You are expected to return a message object, which will be used for subsequent passing down the current segment. If you return NIL, passing stops. This does not affect passing in segments on other splitters. Do note that changing the object itself directly will of course als be reflected at any other point in the pipeline passing, so muting the passed object should be avoided wherever possible. Returns the message.
(
REMOVE-SEGMENT
PIPELINE PLACE
)
Removes the given segment (as well as its children, if any). This also removes any names that either match or go through the specified place and adapts names that would be affected by a place shift. Returns the segment.
(
REPLACE-SEGMENT
PIPELINE PLACE PIPE
)
Replace a place with a pipe. This happens simply through REMOVE-PLACE and INSERT-PIPE. Note that this will destroy names due to REMOVE-PLACE. Returns the segment.
(
SET-NAME
PIPELINE PLACE NAME
)
Associates a place with a name so it can be accessed more easily. Returns the name.
(
WITHDRAW
PLACE &OPTIONAL POSITION
)
Removes an item from the place, by default from the end unless position is set. If position is given, it is expected that the specified item is removed without disturbing any other items and without leaving any empty spaces within the parent. Returns the segment. Do note that using withdraw directly can affect names and make them invalid or point to unexpected segments. You should always use remove-segment instead if possible.