File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 7777from ._anycast import Anycast
7878from ._broadcast import Broadcast
7979from ._exceptions import ChannelClosedError , ChannelError , Error
80+ from ._generic import (
81+ ChannelMessageT ,
82+ ErroredChannelT_co ,
83+ MappedMessageT_co ,
84+ ReceiverMessageT_co ,
85+ SenderMessageT_co ,
86+ SenderMessageT_contra ,
87+ )
8088from ._merge import Merger , merge
8189from ._receiver import Receiver , ReceiverError , ReceiverStoppedError
8290from ._select import (
93101 "Broadcast" ,
94102 "ChannelClosedError" ,
95103 "ChannelError" ,
104+ "ChannelMessageT" ,
96105 "Error" ,
106+ "ErroredChannelT_co" ,
107+ "MappedMessageT_co" ,
97108 "Merger" ,
98109 "Receiver" ,
99110 "ReceiverError" ,
111+ "ReceiverMessageT_co" ,
100112 "ReceiverStoppedError" ,
101113 "SelectError" ,
102114 "Selected" ,
103115 "Sender" ,
104116 "SenderError" ,
117+ "SenderMessageT_co" ,
118+ "SenderMessageT_contra" ,
105119 "UnhandledSelectedError" ,
106120 "merge" ,
107121 "select" ,
Original file line number Diff line number Diff line change 1+ # License: MIT
2+ # Copyright © 2024 Frequenz Energy-as-a-Service GmbH
3+
4+ """Generic type variables."""
5+
6+ from typing import TypeVar
7+
8+ ChannelMessageT = TypeVar ("ChannelMessageT" )
9+ """The type of the message that can be sent across a channel."""
10+
11+ ErroredChannelT_co = TypeVar ("ErroredChannelT_co" , covariant = True )
12+ """The type of channel having an error."""
13+
14+ MappedMessageT_co = TypeVar ("MappedMessageT_co" , covariant = True )
15+ """The type of the message received by the receiver after being mapped."""
16+
17+ ReceiverMessageT_co = TypeVar ("ReceiverMessageT_co" , covariant = True )
18+ """The type of the message received by a receiver."""
19+
20+ SenderMessageT_co = TypeVar ("SenderMessageT_co" , covariant = True )
21+ """The type of the message sent by a sender."""
22+
23+ SenderMessageT_contra = TypeVar ("SenderMessageT_contra" , contravariant = True )
24+ """The type of the message sent by a sender."""
You can’t perform that action at this time.
0 commit comments