modulepackage
0.0.0-20240509064202-0cfc81ebd777
Repository: https://github.com/lowpower/redisq.git
Documentation: pkg.go.dev
# README
redisq
项目实际使用的简易消息队列,提取出来
# Functions
NewTask returns a new Task given a type name and payload data.
ParseRedisURI parses redis uri string and returns RedisConnOpt if uri is valid.
# Constants
No description provided by the author
DebugLevel is the lowest level of logging.
ErrorLevel is used for undesired and unexpected events that the program can recover from.
FatalLevel is used for undesired and unexpected events that the program cannot recover from.
No description provided by the author
InfoLevel is used for general informational log messages.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Indicates that the task is currently being processed by Handler.
Indicates that the task is waiting in a group to be aggregated into one task.
Indicates that the task is archived and stored for inspection purposes.
Indicates that the task is processed successfully and retained until the retention TTL expires.
Indicates that the task is ready to be processed by Handler.
Indicates that the task has previously failed and scheduled to be processed some time in the future.
Indicates that the task is scheduled to be processed some time in the future.
No description provided by the author
No description provided by the author
WarnLevel is used for undesired but relatively expected events, which may indicate a problem.
# Structs
Config specifies the server's background-task processing behavior.
RedisClientOpt is used to create a redis client that connects to a redis server directly.
RedisClusterClientOpt is used to creates a redis client that connects to redis cluster.
RedisFailoverClientOpt is used to creates a redis client that talks to redis sentinels for service discovery and has an automatic failover capability.
ResultWriter is a client interface to write result data for a task.
Server is responsible for task processing and task lifecycle management.
Task represents a unit of work to be performed.
A TaskInfo describes a task and its metadata.
# Interfaces
An ErrorHandler handles an error occurred during task processing.
GroupAggregator aggregates a group of tasks into one before the tasks are passed to the Handler.
A Handler processes tasks.
Logger supports logging at various log levels.
Option specifies the task processing behavior.
RedisConnOpt is a discriminated union of types that represent Redis connection configuration option.
# Type aliases
The ErrorHandlerFunc type is an adapter to allow the use of ordinary functions as a ErrorHandler.
The GroupAggregatorFunc type is an adapter to allow the use of ordinary functions as a GroupAggregator.
LogLevel represents logging level.
No description provided by the author
RetryDelayFunc calculates the retry delay duration for a failed task given the retry count, error, and the task.
TaskState denotes the state of a task.