dureq

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dureq provides top-level convenience constructors for the dureq distributed job scheduling system backed by Redis.

Server:

server, _ := dureq.NewServer(
    dureq.WithRedisURL("redis://localhost:6379"),
    dureq.WithNodeID("node-1"),
)
server.RegisterHandler(types.HandlerDefinition{...})
server.Start(ctx)

Client:

client, _ := dureq.NewClient(dureq.WithClientRedisURL("redis://localhost:6379"))
client.Enqueue(ctx, "email.send", payload)

Index

Constants

This section is empty.

Variables

View Source
var (
	WithRedisURL              = server.WithRedisURL
	WithRedisPassword         = server.WithRedisPassword
	WithRedisDB               = server.WithRedisDB
	WithRedisPoolSize         = server.WithRedisPoolSize
	WithNodeID                = server.WithNodeID
	WithMaxConcurrency        = server.WithMaxConcurrency
	WithSchedulerTickInterval = server.WithSchedulerTickInterval
	WithHeartbeatInterval     = server.WithHeartbeatInterval
	WithElectionTTL           = server.WithElectionTTL
	WithLockTTL               = server.WithLockTTL
	WithLogger                = server.WithLogger
	WithKeyPrefix             = server.WithKeyPrefix
	WithPriorityTiers         = server.WithPriorityTiers
	WithRedisSentinel         = server.WithRedisSentinel
	WithRedisCluster          = server.WithRedisCluster
	WithGroupAggregation      = server.WithGroupAggregation
	WithRetentionPeriod       = server.WithRetentionPeriod
	WithShutdownTimeout       = server.WithShutdownTimeout
)

Server options — re-export from internal/server.

View Source
var (
	WithClientRedisURL      = client.WithRedisURL
	WithClientRedisPassword = client.WithRedisPassword
	WithClientRedisDB       = client.WithRedisDB
	WithClientRedisPoolSize = client.WithRedisPoolSize
	WithClientKeyPrefix     = client.WithKeyPrefix
	WithClientTiers         = client.WithPriorityTiers
	WithClientClusterAddrs  = client.WithClusterAddrs
	WithClientRedisStore    = client.WithStore
)

Client options — re-export from pkg/client.

Functions

func NewClient

func NewClient(opts ...client.Option) (*client.Client, error)

NewClient creates a new dureq client for enqueuing jobs.

func NewServer

func NewServer(opts ...server.Option) (*server.Server, error)

NewServer creates a new dureq server node.

Types

type APIService added in v0.1.5

type APIService = monitor.APIService

func NewAPIService added in v0.1.5

func NewAPIService(s *RedisStore, disp Dispatcher, logger gochainedlog.Logger) *APIService

Re-export APIService

type Client added in v0.1.6

type Client = client.Client

type Dispatcher added in v0.1.5

type Dispatcher = monitor.Dispatcher

type EnqueueGroupOption added in v0.1.3

type EnqueueGroupOption = types.EnqueueGroupOption

Re-export types for group aggregation.

type EnqueueRequest added in v0.1.3

type EnqueueRequest = client.EnqueueRequest

Re-export client types commonly needed by users.

type GroupAggregator added in v0.1.3

type GroupAggregator = types.GroupAggregator

type GroupAggregatorFunc added in v0.1.3

type GroupAggregatorFunc = types.GroupAggregatorFunc

type GroupConfig added in v0.1.3

type GroupConfig = types.GroupConfig

type RedisStore added in v0.1.5

type RedisStore = store.RedisStore

type Server added in v0.1.6

type Server = server.Server

type TierConfig

type TierConfig = store.TierConfig

Re-export store types commonly needed by users.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL