channel

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel[T any] struct {
	sync.Mutex
	// contains filtered or unexported fields
}

模拟无限缓冲的channel,与远程channel特性相同:close后in不能再写入,close并消费空后out返回nil,false

func New

func New[T any]() *Channel[T]

func (*Channel[T]) Close

func (c *Channel[T]) Close()

func (*Channel[T]) In

func (c *Channel[T]) In() chan<- T

func (*Channel[T]) Out

func (c *Channel[T]) Out() <-chan T

Jump to

Keyboard shortcuts

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