Documentation
¶
Index ¶
- type Option
- func WithAddr(addr string) Option
- func WithChannel(channel string) Option
- func WithChannelSize(size int) Option
- func WithCluster() Option
- func WithConnectTimeout(timeout time.Duration) Option
- func WithConnectionString(connectionString string) Option
- func WithDB(db int) Option
- func WithDebug() Option
- func WithLogger(l queue.Logger) Option
- func WithMasterName(masterName string) Option
- func WithPassword(passwd string) Option
- func WithRequestTimeout(timeout time.Duration) Option
- func WithRunFunc(fn func(context.Context, core.TaskMessage) error) Option
- func WithSentinel() Option
- func WithSkipTLSVerify() Option
- func WithTLS() Option
- func WithUsername(username string) Option
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option for queue system
func WithConnectTimeout ¶
WithConnectTimeout bounds initial Redis connection validation.
func WithConnectionString ¶
WithConnectionString redis connection string
func WithMasterName ¶
WithMasterName sentinel master name
func WithRequestTimeout ¶
WithRequestTimeout sets how long Request waits for a published message.
func WithRunFunc ¶
WithRunFunc setup the run func of queue
func WithSkipTLSVerify ¶
func WithSkipTLSVerify() Option
WithSkipTLSVerify returns an Option that configures the TLS settings to skip verification of the server's certificate. This is useful for connecting to servers with self-signed certificates or when certificate verification is not required. Use this option with caution as it makes the connection susceptible to man-in-the-middle attacks.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker for Redis
func NewWorker ¶
NewWorker creates a new Worker instance with the provided options. It initializes a Redis client based on the options and establishes a connection to the Redis server. The Worker is responsible for subscribing to a Redis channel and receiving messages from it. It returns the created Worker instance.
func NewWorkerE ¶
NewWorkerE creates a worker and returns connection and configuration errors.
func (*Worker) BackendName ¶
BackendName identifies Redis Pub/Sub in lifecycle events.
func (*Worker) Queue ¶
func (w *Worker) Queue(job core.TaskMessage) error
Queue send notification to queue