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 ¶
- Variables
- func NewClient(opts ...client.Option) (*client.Client, error)
- func NewServer(opts ...server.Option) (*server.Server, error)
- type APIService
- type Dispatcher
- type EnqueueGroupOption
- type EnqueueRequest
- type GroupAggregator
- type GroupAggregatorFunc
- type GroupConfig
- type RedisStore
- type TierConfig
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 ¶
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 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 TierConfig ¶
type TierConfig = store.TierConfig
Re-export store types commonly needed by users.
Click to show internal directories.
Click to hide internal directories.