In computing, a sink, or data sink generally refers to the destination of data flow.

The word sink has multiple uses in computing. In software engineering, an event sink is a class or function that receives events from another object or function, while a sink can also refer to a node of a directed acyclic graph with no additional nodes leading out from it, among other uses.

In software engineering

An event sink is a class or function designed to receive incoming events from another object or function. This is commonly implemented in C++ as callbacks. Other object-oriented languages, such as Java and C#, have built-in support for sinks by allowing events to be fired to delegate functions.

Due to lack of formal definition, a sink is often misconstrued with a gateway, which is a similar construct but the latter is usually either an end-point or allows bi-direction communication between dissimilar systems, as opposed to just an event input point . This is often seen in C++ and hardware-related programming , thus the choice of nomenclature by a developer usually depends on whether the agent acting on a sink is a producer or consumer of the sink content.

In graph theory

In a Directed acyclic graph, a source node is a node (also known as a vertex) with no incoming connections from other nodes, while a sink node is a node without outgoing connections.[1]

Directed acyclic graphs are used in instruction scheduling, neural networks and data compression.

In stream processing

In several computer programs employing streams, such as GStreamer, PulseAudio, or PipeWire, a source is the starting point of a pipeline which produces a stream but does not consume any, while a sink is the end point which accepts a stream without producing any.[2]

An example is an audio pipeline in the PulseAudio sound system. An input device such as a microphone is a type of audio source, while an output device like a speaker is the audio sink.[3]

Other uses

The word sink has been used for both input and output in the industry. Mobile sink is proposed to save sensor energy for multihop communication in transferring data to a base station (sink) in wireless sensor networks.

See also

References

  1. "What is a sink in graph theory?".
  2. "Elements". GStreamer Documentation.
  3. "About – PulseAudio". PulseAudio.


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.