【问题标题】:What is the meaning of underscore in _ = WriteItems(channel.Writer, count, delay);_ = WriteItems(channel.Writer, count, delay);中的下划线是什么意思
【发布时间】:2019-09-12 17:38:16
【问题描述】:

我正在阅读有关 SignalR 的信息,并找到了代码:

  public ChannelReader<int> Counter(int count, int delay)
{
    var channel = Channel.CreateUnbounded<int>();

    // We don't want to await WriteItems, otherwise we'd end up waiting 
    // for all the items to be written before returning the channel back to
    // the client.
    _ = WriteItems(channel.Writer, count, delay);

    return channel.Reader;
}

下划线是什么意思?是可变的吗?

【问题讨论】:

标签: c# system.threading.channels


【解决方案1】:

我可能错了,但对我来说它看起来像 discard

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-25
    • 2015-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多