@@ -43,46 +43,12 @@ func Providers() di.Deps {
43
43
// Gauge is an alias used for dependency injection
44
44
type Gauge metrics.Gauge
45
45
46
- // ConsumableDispatcher is the key JobFrom *Queue in the dependencies graph. Used as a type hint for injection.
46
+ // ConsumableDispatcher is the key of *Queue in the dependencies graph. Used as a type hint for injection.
47
47
type ConsumableDispatcher interface {
48
48
JobDispatcher
49
49
Consume (ctx context.Context ) error
50
50
}
51
51
52
- // DispatcherFactory is a factory for *Queue. Note DispatcherFactory doesn't contain the factory method
53
- // itself. ie. How to factory a dispatcher left there for users to define. Users then can use this type to create
54
- // their own dispatcher implementation.
55
- //
56
- // Here is an example on how to create a custom DispatcherFactory with an InProcessDriver.
57
- //
58
- // factory := di.NewFactory(func(name string) (di.Pair, error) {
59
- // queuedDispatcher := queue.NewQueue(
60
- // &Jobs.SyncDispatcher{},
61
- // queue.NewInProcessDriver(),
62
- // )
63
- // return di.Pair{Conn: queuedDispatcher}, nil
64
- // })
65
- // dispatcherFactory := DispatcherFactory{Factory: factory}
66
- //
67
- type DispatcherFactory struct {
68
- * di.Factory
69
- }
70
-
71
- // Make returns a Queue by the given name. If it has already been created under the same name,
72
- // the that one will be returned.
73
- func (s DispatcherFactory ) Make (name string ) (* Queue , error ) {
74
- client , err := s .Factory .Make (name )
75
- if err != nil {
76
- return nil , err
77
- }
78
- return client .(* Queue ), nil
79
- }
80
-
81
- // DispatcherMaker is the key JobFrom *DispatcherFactory in the dependencies graph. Used as a type hint for injection.
82
- type DispatcherMaker interface {
83
- Make (string ) (* Queue , error )
84
- }
85
-
86
52
type configuration struct {
87
53
RedisName string `yaml:"redisName" json:"redisName"`
88
54
Parallelism int `yaml:"parallelism" json:"parallelism"`
0 commit comments