cchan

package
v0.4.0-nightly.20221116 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chan

type Chan[T any] <-chan T

Chan is a channel with utility methods.

func (Chan[T]) Recv

func (c Chan[T]) Recv(ctx context.Context) (T, bool, error)

Recv will try to receive a value from the channel, same as <-c. If the context is canceled before a value is received, it will return the context error.

func (Chan[T]) RecvTimeout

func (c Chan[T]) RecvTimeout(ctx context.Context, timeout time.Duration) (T, bool, error)

RecvTimeout will try to receive a value from the channel, same as <-c. If the context is canceled before a values is received or the timeout is reached, it will return the context error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL