What is Piping?
Piping is a simple library for Common Lisp to construct message-passing systems in a form similar to pipelines.
Piping is a simple library for Common Lisp to construct message-passing systems in a form similar to pipelines.
Load Piping with ASDF or Quicklisp.
(ql:quickload :piping)
Create a new pipeline:
(setf pipeline
(make-instance 'pipeline
:source (build-pipeline (make-instance 'source)
(valve :name "MAIN-VALVE")
(print-faucet :name "PRINTER"))))
Pass a message along it:
(pass pipeline "Hello Plumbers!")
Print the pipeline, retrieve a segment and change it:
(print-flow pipeline *standard-output*)(close-valve (get-pipe pipeline "MAIN-VALVE"))
Pipe systems are still a bit complicated to build and handle. I'm intending on reworking this in the future to make it simple to build and manipulate on the fly.
Piping is a sub-project of TyNETv5 ("Radiance"), licensed under the Artistic License 2.0 and ©2013 TymoonNET/NexT, Nicolas Hafner.
This program can be obtained via git on git://git.tymoon.eu/piping.git. For questions, patches or suggestions, please contact me via email.
ACTIVE
(SB-PCL::OBJECT)
ACTIVE-SWITCH
A switch that can actively change its target pipe depending on the message.
ACTIVE-VALVE
An active valve that closes or opens depending on specific messages.
ADD-PIPE
(PIPELINE CLASS-OR-INSTANCE &REST ARGS)
BUILD-PIPELINE
(SOURCE &BODY PIPES)
CLOSE-FUNC
(SB-PCL::OBJECT)
CLOSE-VALVE
(VALVE &OPTIONAL (STATUS))
CONNECT-NEW
(SPLITTER SEGMENT)
Connect a new element to the splitter.
CONNECT-NEXT
(PIPE SEGMENT)
Connect the pipe's next with the given segment.
CONNECT-PREV
(PIPE SEGMENT)
Connect the pipe's previous with the given segment.
DISCONNECT
(SPLITTER SEGMENT)
Disconnect an existing element from the splitter.
DISCONNECT-NEXT
(PIPE)
Disconnect the next segment.
DISCONNECT-PREV
(PIPE)
Disconnect the previous segment.
FAUCET
An endpoint for pipe messages to arrive at.
FILE-FAUCET
A faucet that prints everything to file.
FILTER
Pipe segment that filters messages according to a test function.
GET-PIPE
(PIPELINE NAME)
INSERT-AFTER
(PIPE PIPE-TO-INSERT)
Insert a new pipe element in between this and the one after.
INSERT-BEFORE
(PIPE PIPE-TO-INSERT)
Insert a new pipe element in between this and the one before.
MAKE-ACTIVE
(SWITCH SEGMENT-OR-INDEX &KEY (TEST #'EQL))
Makes the given segment or index active.
MESSAGE
(CONDITION)
MIX
(SB-PCL::OBJECT)
MIXER
A pipe segment that actively changes components of the message.
NAME
(SB-PCL::OBJECT)
NEXT
(SB-PCL::OBJECT)
ON-CLOSED
(SB-PCL::OBJECT)
OPEN-FUNC
(SB-PCL::OBJECT)
OPEN-VALVE
(VALVE &OPTIONAL (STATUS))
OPENED
(SB-PCL::OBJECT)
PASS
(SEGMENT MESSAGE)
Pass a message through the segment.
PIPE
Base pipe class.
PIPELINE
A class to hold easy access to pipe segments and the pipe system as a whole.
PIPES
(SB-PCL::OBJECT)
PREV
(SB-PCL::OBJECT)
PRINT-FAUCET
A faucet that simply prints all the messages to stdout
PRINT-FLOW
(PIPE STREAM)
Print this and all following pipes as a flow diagram.
PRINT-SELF
(SEGEMENT STREAM)
Print a representation of itself without connecting segments.
REMOVE-AFTER
(PIPE)
Pop out the element after this one and return it. Tries to retain the pipeline.
REMOVE-BEFORE
(PIPE)
Pop out the element before this one and return it. Tries to retain the pipeline.
REMOVE-THIS
(PIPE)
Pop out this pipe element and return it. Tries to retain the pipeline.
REPLACE-THIS
(PIPE PIPE-TO-INSERT)
Replace this pipe element with the given one and return the old one.
SEGMENT
Base segment class.
SOURCE
A source for the pipe system that feeds messages down the pipeline.
SOURCE
(SB-PCL::OBJECT)
SPLITTER
Splits the messages up and passes them to multiple targets.
STRING-STREAM-FAUCET
A faucet that prints everything to a string stream.
SWITCH
A switch connects to multiple pipes but only passes to one.
TARGETS
(SB-PCL::OBJECT)
TEST
(SB-PCL::OBJECT)
VALVE
Valves allow you to regulate the passing process.
VALVE
(CONDITION)
VALVE-CLOSED
Condition signalled when a message arrives at a closed valve.