Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Golang asynchronous task/job queue with Redis, SQS, IronMQ, and in-memory backends

License

NotificationsYou must be signed in to change notification settings

vmihailenco/taskq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

500 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build workflowPkgGoDevDocumentationChat

taskq is brought to you by ⭐uptrace/uptrace.Uptrace is an open source and blazingly fastdistributed tracing tool poweredby OpenTelemetry and ClickHouse. Give it a star as well!

Features

  • Redis, SQS, IronMQ, and in-memory backends.
  • Automatically scaling number of goroutines used to fetch (fetcher) and process messages (worker).
  • Global rate limiting.
  • Global limit of workers.
  • Call once - deduplicating messages with same name.
  • Automatic retries with exponential backoffs.
  • Automatic pausing when all messages in queue fail.
  • Fallback handler for processing failed messages.
  • Message batching. It is used in SQS and IronMQ backends to add/delete messages in batches.
  • Automatic message compression using snappy / s2.

Resources:

Getting started

To get started, seeGolang Task Queue documentation.

Producer:

import ("github.com/vmihailenco/taskq/v3""github.com/vmihailenco/taskq/v3/redisq")// Create a queue factory.varQueueFactory=redisq.NewFactory()// Create a queue.varMainQueue=QueueFactory.RegisterQueue(&taskq.QueueOptions{Name:"api-worker",Redis:Redis,// go-redis client})// Register a task.varCountTask=taskq.RegisterTask(&taskq.TaskOptions{Name:"counter",Handler:func()error {IncrLocalCounter()returnnil    },})ctx:=context.Background()// And start producing.for {// Call the task without any args.err:=MainQueue.Add(CountTask.WithArgs(ctx))iferr!=nil {panic(err)}time.Sleep(time.Second)}

Consumer:

// Start consuming the queue.iferr:=MainQueue.Start(context.Background());err!=nil {log.Fatal(err)}

See also

Contributors

Thanks to all the people who already contributed!

About

Golang asynchronous task/job queue with Redis, SQS, IronMQ, and in-memory backends

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors15

Languages


[8]ページ先頭

©2009-2026 Movatter.jp