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.
- Host: GitHub
- URL: https://github.com/mehditeymorian/superchan
- Owner: mehditeymorian
- License: apache-2.0
- Created: 2022-05-17T06:52:38.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-17T06:59:51.000Z (about 4 years ago)
- Last Synced: 2025-01-23T17:34:32.663Z (over 1 year ago)
- Topics: channels, generic, go, golang, rate
- Language: Go
- Homepage:
- Size: 83 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Superchan
Superchan is the same chan but generic and with rate calculator, capable of monitoring input and output data transmission rate.
# 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())
```