Skip to content

Commit faa24fb

Browse files
authored
Merge pull request #113 from bergos/generic-sink
generic Sink.import for Parser, Serializer, Transform and Store
2 parents ecd0d82 + 5a2c310 commit faa24fb

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

interface-spec.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,24 @@ For example, parsers and transformations which generate quads can implement the
181181

182182
### Sink
183183

184-
A Sink is an object that consumes quads.
185-
It can store the quads or do some further processing.
186-
For example serializers and transformations which consume quads can implement the Sink interface.
184+
A Sink is an object that consumes data from different kinds of streams.
185+
It can store the content of the stream or do some further processing.
186+
For example parsers, serializers, transformations and stores can implement the Sink interface.
187187

188188
- `EventEmitter .import(Stream stream)`
189-
Writes all quads from the stream to the sink.
189+
Consumes the given stream.
190+
The `end` and `error` events are used like described in the `Stream` interface.
191+
Depending on the use case, subtypes of `EventEmitter` or `Stream` are used.
192+
193+
Typical use cases:
194+
195+
**Parser:** `Stream<Quad> .import(Stream stream)`
196+
197+
**Serializer:** `Stream .import(Stream<Quad> stream)`
198+
199+
**Transformation:** `Stream<Quad> .import(Stream<Quad> stream)`
200+
201+
**Store:** `EventEmitter .import(Stream<Quad> stream)`
190202

191203
### Store extends Source, Sink
192204

0 commit comments

Comments
 (0)