Simple, reliable, and efficient distributed task queue in Go
MIT License
Bot releases are hidden (Show)
Published by hibiken almost 2 years ago
PreEnqueueFunc
, PostEnqueueFunc
is added in Scheduler
and deprecated EnqueueErrorHandler
(PR: https://github.com/hibiken/asynq/pull/476)Scheduler
failed to enqueue a task. Use PostEnqueueFunc
to check for errors and task actions if needed.Scheduler
failed to record SchedulerEnqueueEvent
.Published by hibiken over 2 years ago
This version adds Task Aggregation feature and includes a few improvements and fixes.
This is a new feature which allows you to enqueue multiple tasks successively, and have them passed to the Handler together rather than individually. The feature allows you to batch multiple successive operations into one, in order to save on costs, optimize caching, or batch notifications, for example. See the Wiki page for details.
Group
option is introduced to enqueue task in a group.GroupAggregator
and related types are introduced for task aggregation feature.GroupGracePeriod
, GroupMaxSize
, GroupMaxDelay
, and GroupAggregator
fields are added to Config
.Inspector
has new methods related to "aggregating tasks".Group
field is added to TaskInfo
.group ls
command is addedtask ls
supports listing aggregating tasks via --state=aggregating --group=<GROUP>
flagsPublished by hibiken over 2 years ago
Published by hibiken over 2 years ago
This version improves worker crash recovery by introducing a concept of worker lease for an active task.
It also adds an optional field to Config
to customize the context passed to the Handler
.
Important Note:
Since this version changes the logic of crash recovery, update of the library version should be done with a clean restart of the process.
In other words, please make sure that the process running asynq.Server
shutdown cleanly before restarting the process with this new version.
BaseContext
is introduced in Config
to specify callback hook to provide a base context
from which Handler
context
is derivedIsOrphaned
field is added to TaskInfo
to describe a task left in active state with no worker processing it.Server
now recovers tasks with an expired lease. Recovered tasks are retried/archived with ErrLeaseExpired
error.Published by hibiken over 2 years ago
PeriodicTaskManager
is added. Prefer using this over Scheduler
as it has better support for dynamic periodic tasks. See the wiki page for an example of using PeriodicTaskManager
asynq stats
command now supports a --json
option, making its output a JSON objectDelayedTaskCheckInterval
. See godoc for more details.Published by hibiken almost 3 years ago
This release includes changes to support Prometheus integration in the Web UI. The integration is optional, there shouldn't be any changes in performance or behavior of the library in this release.
x/metrics
is added.tools/metrics_exporter
binary is added.ProcessedTotal
and FailedTotal
fields were added to QueueInfo
struct.Published by hibiken almost 3 years ago
This release includes a few additions and one fix.
Latency
field is added to QueueInfo
.EnqueueContext
method is added to Client
.Unique
optionPublished by hibiken almost 3 years ago
This release includes an introduction of task retention after successful processing. With Retention
option, you can specify how long the task should be retained in the queue as a completed task.
NewTask
takes Option
as variadic argumentRetention
option is added to allow user to specify task retention duration after completion.TaskID
option is added to allow user to specify task ID.ErrTaskIDConflict
sentinel error value is added.ResultWriter
type is added and provided through Task.ResultWriter
method.TaskInfo
has new fields CompletedAt
, Result
and Retention
.Client.SetDefaultOptions
is removed. Use NewTask
instead to pass default options for tasks.Published by hibiken about 3 years ago
This release fixes CLI import issue
github.com/go-redis/redis
version to v8Published by hibiken about 3 years ago
This release includes one addition to the server config.
IsFailure
config option is added to Config
to determine whether error returned from Handler counts as a failure.
Published by hibiken about 3 years ago
This release includes one fix.
Register
and Unregister
concurrently.Published by hibiken about 3 years ago
This release includes minor change around task typename and critical performance fix for tooling (CLI, Web UI).
Queue
function to not to convert the provided queue name to lowercase. Queue names are now case-sensitive.QueueInfo.MemoryUsage
is now an approximate usage value.Published by hibiken over 3 years ago
This release includes one change.
Queue
function is updated to not to convert the provided queue name to lowercase.Published by hibiken over 3 years ago
This release includes a minor change and critical fix in the task recovering logic (tasks left in active state due to server crash).
Published by hibiken over 3 years ago
Asynq 0.18 includes major API changes and changes to the tooling (WebUI and CLI).
The inspeq
sub package is removed, and all types and functions from the package are moved to asynq
package.
The upgrade guide is available here
NewTask
function takes array of bytes as payload.Type
and Payload
is accessed by a method call (previously these were fields on Task
).Server
API has changed. Renamed Quiet
to Stop
. Renamed Stop
to Shutdown
. Note: As a result of this renaming, the behavior of Stop
has changed. Please update the existing code to call Shutdown
where it used to call Stop
.Stop
to Shutdown
.Client.Enqueue
returns TaskInfo
(Previously returned Result
struct)inspeq
package is removed. All types and functions from the package is moved to asynq
package.Inspector.RunTaskByKey
is replaced with Inspector.RunTask
Inspector.DeleteTaskByKey
is replaced with Inspector.DeleteTask
Inspector.ArchiveTaskByKey
is replaced with Inspector.ArchiveTask
WorkerInfo
field names have changed.Inspector.CancelActiveTask
is renamed to Inspector.CancelProcessing
Inspector
List methods (e.g. ListActiveTasks
) returns slice of TaskInfo
asynq task delete|run|archive
commands takes take ID as well as the queue name (previously required task key)asynq task delete --queue=QUEUE --id=TASK_ID
Published by hibiken over 3 years ago
This release includes one bug fix.
Published by hibiken over 3 years ago
This release includes one bug fix.
RDB.memoryUsage
method.Published by hibiken over 3 years ago
This release includes one minor update to RedisConnOpt
to support redis connection timeouts.
DialTimeout
, ReadTimeout
, and WriteTimeout
options are added to RedisConnOpt
types.