An open API service indexing awesome lists of open source software.

https://github.com/mehditeymorian/superchan

Superchan is the same chan but generic and with rate calculator, capable of monitoring input and output data transmission rate.
https://github.com/mehditeymorian/superchan

channels generic go golang rate

Last synced: about 1 year ago
JSON representation

Superchan is the same chan but generic and with rate calculator, capable of monitoring input and output data transmission rate.

Awesome Lists containing this project

README

          


Superchan

Superchan


Superchan is the same chan but generic and with rate calculator, capable of monitoring input and output data transmission rate.




go version
 
license

# Installation
```shell
go get github.com/mehditeymorian/superchan
```

# Usage
```Go
// Create a new Superchan
c := superchan.New[type](channelSize)

// send data into the channel
c.Send(n)

// receive data from the channel
c.Receive()

// monitor rates
log.Printf("buffer: %d in: %d/s out: %d/s\n", c.BufferedSize(), c.InputRate(), c.OutputRate())
```