Categorygithub.com/zyylhn/bufferChannel
modulepackage
1.1.0
Repository: https://github.com/zyylhn/bufferchannel.git
Documentation: pkg.go.dev

# README

longChannel

一个不限制长度的channel,不会发生阻塞但是会将所有内容缓存到内存 中

type InfiniteChan struct {
	bufCount int64
	In       chan<- T    // channel for write
	Out      <-chan T    // channel for read
	buffer   *RingBuffer // buffer
}

向In中写入东西,从Out中读取,buffer用来起到缓冲区的作用,当In中写入东西就转发out中,当out 满了就存放在缓冲区中,只要缓冲区不为空,就一直向缓冲区写。以此实现类似于无限长度的channel的作用

TODO

  • 内存缓冲
  • 磁盘缓冲
  • 连接rabbitmq使用rabbitmq封装成一个不限制长度的channel

# Functions

NewInfiniteChan 指定一个初始长度.
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author