Sink Base

class gpype.backend.sinks.base.sink.Sink[source]

Bases: INode

Base for a node whose output leaves this process.

A file on disk, a socket, an LSL stream. What they share is not how they are written but where they are: a sink has a location, so a distributed pipeline has to decide which process builds it, and that is what a chain exists to express.

That is the whole content of this class. It declares no parameters, no ports and no behaviour, and deliberately so – it names a property that was previously implicit and unreadable. Before it, _CsvWriterCore was a FileWriter(INode) and _LSLSenderCore a bare INode, and nothing in the hierarchy separated either from Collector, which is an INode too. So a reader could not tell which nodes needed a chain, and neither could the Pipeline once it started building them – see assembly.kind_of.

`Collector` is not one, and that is the line this class draws. It “terminates a pipeline in memory instead of in a file”: it hands data back to the caller inside this process, has no external endpoint, and no residency question to answer. A node that only touches data needs no chain, whether or not it happens to sit at the end of a pipeline.

Public as gp.Sink. Subclass it for a sink of your own; subclass INode directly for one that keeps its output in the process, as Collector does.

attach_entitlement(verdict)[source]

Record whether this run’s output must be marked.

Called by the pipeline before anything starts, because output written first would carry the wrong answer.

Parameters:

verdict – The pipeline’s resolved Entitlement.

Return type:

None