Skip to content

Commit

Permalink
feat: exports broker releated types
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdong.106 committed Dec 3, 2024
1 parent 7986156 commit 08969e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"time"

"github.com/google/uuid"
"github.com/hibiken/asynq/broker"
"github.com/hibiken/asynq/internal/base"
"github.com/hibiken/asynq/internal/errors"
"github.com/hibiken/asynq/internal/rdb"
Expand Down Expand Up @@ -49,7 +50,7 @@ func NewClientFromRedisClient(c redis.UniversalClient) *Client {

// NewClientFromBroker returns a new instance of Client given a broker.
// Warning: The underlying broker will not be closed by Asynq, you are responsible for closing it.
func NewClientFromBroker(b base.Broker) *Client {
func NewClientFromBroker(b broker.Broker) *Client {
return &Client{broker: b, sharedConnection: true}
}

Expand Down
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"sync"
"time"

"github.com/hibiken/asynq/broker"
"github.com/hibiken/asynq/internal/base"
"github.com/hibiken/asynq/internal/log"
"github.com/hibiken/asynq/internal/rdb"
Expand Down Expand Up @@ -449,7 +450,7 @@ func NewServerFromRedisClient(c redis.UniversalClient, cfg Config) *Server {

// NewServerFromBroker returns a new instance of Server given a Broker and server configuration.
// Warning: The underlying broker will not be closed by Asynq, you are responsible for closing it.
func NewServerFromBroker(b base.Broker, cfg Config) *Server {
func NewServerFromBroker(b broker.Broker, cfg Config) *Server {
baseCtxFn := cfg.BaseContext
if baseCtxFn == nil {
baseCtxFn = context.Background
Expand Down

0 comments on commit 08969e1

Please sign in to comment.