Skip to content

Commit ba3dec9

Browse files
committed
Add a short description of the contents of each module
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 19591ab commit ba3dec9

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

src/frequenz/channels/__init__.py

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,49 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""Channel implementations."""
4+
"""Frequenz Channels.
5+
6+
This package contains
7+
[channel](https://en.wikipedia.org/wiki/Channel_(programming)) implementations.
8+
9+
Channels:
10+
11+
* [Anycast][frequenz.channels.Anycast]: A channel that supports multiple
12+
senders and multiple receivers. A message sent through a sender will be
13+
received by exactly one receiver.
14+
15+
* [Bidirectional][frequenz.channels.Bidirectional]: A channel providing
16+
a `client` and a `service` handle to send and receive bidirectionally.
17+
18+
* [Broadcast][frequenz.channels.Broadcast]: A channel to broadcast messages
19+
from multiple senders to multiple receivers. Each message sent through any of
20+
the senders is received by all of the receivers.
21+
22+
Other base classes:
23+
24+
* [Peekable][frequenz.channels.Peekable]: An object to allow users to get
25+
a peek at the latest value in the channel, without consuming anything.
26+
27+
* [Receiver][frequenz.channels.Receiver]: An object that can wait for and
28+
consume messages from a channel.
29+
30+
* [Sender][frequenz.channels.Sender]: An object that can send messages to
31+
a channel.
32+
33+
Utilities:
34+
35+
* [util][frequenz.channels.util]: A module with utilities, like special
36+
receivers that implement timers, file watchers, merge receivers, or wait for
37+
messages in multiple channels.
38+
39+
Exception classes:
40+
41+
* [ChannelError][frequenz.channels.ChannelError]: Base class for all errors
42+
related to channels.
43+
44+
* [ChannelClosedError][frequenz.channels.ChannelClosedError]: Error raised when
45+
trying to operate (send, receive, etc.) through a closed channel.
46+
"""
547

648
from . import util
749
from ._anycast import Anycast

src/frequenz/channels/util/__init__.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
11
# License: MIT
22
# Copyright © 2022 Frequenz Energy-as-a-Service GmbH
33

4-
"""Channel utilities."""
4+
"""Channel utilities.
5+
6+
A module with several utilities to work with channels:
7+
8+
* [FileWatcher][frequenz.channels.util.FileWatcher]:
9+
A [receiver][frequenz.channels.Receiver] that watches for file events.
10+
11+
* [Merge][frequenz.channels.util.Merge]:
12+
A [receiver][frequenz.channels.Receiver] that merge messages coming from
13+
multiple receivers into a single stream.
14+
15+
* [MergeNamed][frequenz.channels.util.MergeNamed]:
16+
A [receiver][frequenz.channels.Receiver] that merge messages coming from
17+
multiple receivers into a single named stream, allowing to identify the
18+
origin of each message.
19+
20+
* [Select][frequenz.channels.util.Select]: A helper to select the next
21+
available message for each [receiver][frequenz.channels.Receiver] in a group
22+
of receivers.
23+
24+
* [Timer][frequenz.channels.util.Timer]:
25+
A [receiver][frequenz.channels.Receiver] that emits a *now* `timestamp`
26+
every `interval` seconds.
27+
"""
528

629
from ._file_watcher import FileWatcher
730
from ._merge import Merge

0 commit comments

Comments
 (0)