Zet
Zet

Reputation: 571

What is the meaning of underscore in _ = WriteItems(channel.Writer, count, delay);

I'm reading about SignalR and I have found code:

  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;
}

What is the meaning of underscore? Is it variable?

Upvotes: 2

Views: 179

Answers (1)

David Osborne
David Osborne

Reputation: 6791

I could be wrong but it looks like a discard to me.

Upvotes: 3

Related Questions