Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Channel.cs
Go to the documentation of this file.
1
namespace
System.Threading.Channels
;
2
3
public
static
class
Channel
4
{
5
public
static
Channel<T>
CreateUnbounded<T>
()
6
{
7
return
new
UnboundedChannel<T>
(runContinuationsAsynchronously:
true
);
8
}
9
10
public
static
Channel<T>
CreateUnbounded<T>
(
UnboundedChannelOptions
options
)
11
{
12
if
(
options
!=
null
)
13
{
14
if
(!
options
.SingleReader)
15
{
16
return
new
UnboundedChannel<T>
(!
options
.AllowSynchronousContinuations);
17
}
18
return
new
SingleConsumerUnboundedChannel<T>
(!
options
.AllowSynchronousContinuations);
19
}
20
throw
new
ArgumentNullException
(
"options"
);
21
}
22
23
public
static
Channel<T>
CreateBounded<T>
(
int
capacity
)
24
{
25
if
(
capacity
< 1)
26
{
27
throw
new
ArgumentOutOfRangeException
(
"capacity"
);
28
}
29
return
new
BoundedChannel<T>
(
capacity
,
BoundedChannelFullMode
.Wait, runContinuationsAsynchronously:
true
,
null
);
30
}
31
32
public
static
Channel<T>
CreateBounded<T>
(
BoundedChannelOptions
options
)
33
{
34
return
CreateBounded<T>
(
options
,
null
);
35
}
36
37
public
static
Channel<T>
CreateBounded<T>
(
BoundedChannelOptions
options
, Action<T>? itemDropped)
38
{
39
if
(
options
==
null
)
40
{
41
throw
new
ArgumentNullException
(
"options"
);
42
}
43
return
new
BoundedChannel<T>
(
options
.Capacity,
options
.FullMode, !
options
.AllowSynchronousContinuations, itemDropped);
44
}
45
}
46
public
abstract
class
Channel<T> : Channel<T, T>
47
{
48
}
49
public
abstract
class
Channel
<TWrite, TRead>
50
{
51
public
ChannelReader<TRead>
Reader {
get
;
protected
set
; }
52
53
public
ChannelWriter<TWrite>
Writer {
get
;
protected
set
; }
54
55
public
static
implicit
operator
ChannelReader<TRead>
(
Channel<TWrite, TRead>
channel)
56
{
57
return
channel.Reader;
58
}
59
60
public
static
implicit
operator
ChannelWriter<TWrite>
(
Channel<TWrite, TRead>
channel)
61
{
62
return
channel.Writer;
63
}
64
}
System.ArgumentNullException
Definition
ArgumentNullException.cs:10
System.ArgumentOutOfRangeException
Definition
ArgumentOutOfRangeException.cs:9
System.Threading.Channels.BoundedChannelOptions
Definition
BoundedChannelOptions.cs:4
System.Threading.Channels.BoundedChannel
Definition
BoundedChannel.cs:11
System.Threading.Channels.ChannelReader
Definition
ChannelReader.cs:9
System.Threading.Channels.ChannelWriter
Definition
ChannelWriter.cs:6
System.Threading.Channels.Channel.CreateUnbounded< T >
static Channel< T > CreateUnbounded< T >()
Definition
Channel.cs:5
System.Threading.Channels.Channel.CreateBounded< T >
static Channel< T > CreateBounded< T >(int capacity)
Definition
Channel.cs:23
System.Threading.Channels.Channel
Definition
Channel.cs:50
System.Threading.Channels.SingleConsumerUnboundedChannel
Definition
SingleConsumerUnboundedChannel.cs:12
System.Threading.Channels.UnboundedChannelOptions
Definition
UnboundedChannelOptions.cs:4
System.Threading.Channels.UnboundedChannel
Definition
UnboundedChannel.cs:12
System.Threading.Channels.BoundedChannelFullMode
BoundedChannelFullMode
Definition
BoundedChannelFullMode.cs:4
System.Threading.Channels
Definition
AsyncOperation.cs:6
System.ExceptionArgument.capacity
@ capacity
System.ExceptionArgument.options
@ options
source
System.Threading.Channels
System.Threading.Channels
Channel.cs
Generated by
1.10.0