Chanman helps you to create queue channels and manage them gracefully.

chanman

Channels are widely used as queues. chanman (Channel Manager) helps you to easily create queue with channel and manage the data in the queue. You don't have to be afraid of panic situations like channel is already closed etc.

Usage

func main() {
	var callbackFn chanman.CallbackFn = func(data interface{}) error {
		t.Logf("callbackFn: %v", data)
		return nil
	}

	opts := &chanman.Options{
		CallbackFn: callbackFn,
		Limit:      10,
		Worker:     5,
		DataSize:   32,
	}

	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	queue := chanman.New(ctx, opts)

	go queue.Listen()

	for i := 0; i <= 20; i++ {
		queue.Add(fmt.Sprintf("job-%d", i))
	}
}
Owner
Erhan Yakut
Developer
Erhan Yakut
Similar Resources

A lightweight, distributed and reliable message queue based on Redis

nmq A lightweight, distributed and reliable message queue based on Redis Get Started Download go get github.com/inuggets/nmq Usage import "github.com

Nov 22, 2021

A basic event queue (and publisher/subscriber) in go

queue A basic event queue (and publisher/subscriber) in go. Installation go get github.com/jimjibone/queue Queue Usage Queue is a channel-based FIFO q

Dec 17, 2021

implentacion queue in kafka, rabbit and sqs

Big Queue on Go This is a simple big queue and implementation in kafka, rabbit and aws sqs. Publish in a topic in kafka: Use NewPublisher method to cr

Dec 29, 2021

A single binary, simple, message queue.

MiniQueue A stupid simple, single binary message queue using HTTP/2. Most messaging workloads don't require enormous amounts of data, endless features

Nov 9, 2022

dque is a fast, embedded, durable queue for Go

dque - a fast embedded durable queue for Go dque is: persistent -- survives program restarts scalable -- not limited by your RAM, but by your disk spa

Jan 8, 2023

Gue is Golang queue on top of PostgreSQL that uses transaction-level locks.

Gue is Golang queue on top of PostgreSQL that uses transaction-level locks.

Jan 4, 2023

Queue with NATS Jetstream to remove all the erlangs from cloud

Saf in Persian means Queue. One of the problems, that we face on projects with queues is deploying RabbitMQ on the cloud which brings us many challenges for CPU load, etc. I want to see how NATS with Jetstream can work as the queue to replace RabbitMQ.

Dec 15, 2022

A fast durable queue for Go

pqueue - a fast durable queue for Go pqueue is thread-safety, serves environments where more durability is required (e.g., outages last longer than me

Oct 16, 2022

Redis as backend for Queue Package

Redis as backend for Queue Package

redis Redis as backend for Queue package Setup start the redis server redis-server start the redis cluster, see the config # server 01 mkdir server01

Oct 16, 2022
Comments
  • Data size must be limited

    Data size must be limited

    We are not checking data size for now. This checking needed for limiting data size because we keep data on memory and we don't want to using memory aggressively. We should define size limit like:

    	opts := &chanman.Options{
    		CallbackFn: callbackFn,
    		Limit:      19,
    		Worker:     5,
    		DataSize: 1024, // This will be added
    	}
    

    For unlimited size we can use DataSize: 0 Can someone handle this?

  • Change the repo name

    Change the repo name

    Chanman is a nice name but I think we deserve better. Related keywords for new name are:

    channel queue job worker task

    What do you think? @yusufpapurcu @halilkocaoz

  • Worker pool method needs to be added

    Worker pool method needs to be added

    For now, jobs are processing by 1 worker. We need to add worker pool method to make workers do the job.

    User should define the worker number with options like:

    opts := &chanman.Options{
    		CallbackFn: callbackFn,
    		Limit:      10,
    		Worker: 5, // This will be added
    	}
    

    Some useful documents: https://brandur.org/go-worker-pool https://medium.com/code-chasm/go-concurrency-pattern-worker-pool-a437117025b1

    Anyone wants to take this job?

Related tags
M3U generator for Stirr, optimized for Channels' custom channels.
M3U generator for Stirr, optimized for Channels' custom channels.

Stirr for Channels This simple Docker image will generate an M3U playlist and EPG optimized for use in Channels and expose them over HTTP. Channels su

Oct 7, 2022
A Multi Consumer per Message Queue with persistence and Queue Stages.
 A Multi Consumer per Message Queue with persistence and Queue Stages.

CrimsonQ A Multi Consumer per Message Queue with persistence and Queue Stages. Under Active Development Crimson Queue allows you to have multiple cons

Jul 30, 2022
Open source Observability Platform. 👉 SigNoz helps developers find issues in their deployed applications & solve them quickly
Open source Observability Platform. 👉 SigNoz helps developers find issues in their deployed applications & solve them quickly

SigNoz SigNoz is an opensource observability platform. SigNoz uses distributed tracing to gain visibility into your systems and powers data using Kafk

Jan 4, 2023
Machinery is an asynchronous task queue/job queue based on distributed message passing.
Machinery is an asynchronous task queue/job queue based on distributed message passing.

Machinery Machinery is an asynchronous task queue/job queue based on distributed message passing. V2 Experiment First Steps Configuration Lock Broker

Jan 7, 2023
An opinionated package that helps you print user-friendly output messages from your Go command line applications.

github.com/eth-p/clout (Command Line Output) clout is a package that helps you print user-friendly output messages from your Go command line applicati

Jan 15, 2022
a unified representation of buffered, unbuffered, and unbounded channels in Go

chann a unified representation of buffered, unbuffered, and unbounded channels in Go import "golang.design/x/chann" This package requires Go 1.18. Us

Oct 31, 2022
Pause / Unpause NSQ Topics and Channels

Action pause unpause empty info check Worker Pool 1 <= n <= len(target) 0 for unlimited pool depend on how many the targets Target Array of topics or

Jun 29, 2022
Asynq: simple, reliable, and efficient distributed task queue in Go
Asynq: simple, reliable, and efficient distributed task queue in Go

Asynq Overview Asynq is a Go library for queueing tasks and processing them asynchronously with workers. It's backed by Redis and is designed to be sc

Dec 30, 2022
RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue

RapidMQ RapidMQ is a pure, extremely productive, lightweight and reliable library for managing of the local messages queue in the Go programming langu

Sep 27, 2022
redisqueue provides a producer and consumer of a queue that uses Redis streams

redisqueue redisqueue provides a producer and consumer of a queue that uses Redis streams. Features A Producer struct to make enqueuing messages easy.

Dec 29, 2022