Comments (5)
A Pubsub Interface like this will help, I just copied the redis pubsub methods:
type Message struct {
Channel string
Payload string
}
type PubSub interface {
Subscribe(ctx context.Context, channels ...string) error
PSubscribe(ctx context.Context, patterns ...string) error
SSubscribe(ctx context.Context, channels ...string) error
Unsubscribe(ctx context.Context, channels ...string) error
PUnsubscribe(ctx context.Context, patterns ...string) error
SUnsubscribe(ctx context.Context, channels ...string) error
Ping(ctx context.Context, payload ...string) error
ReceiveTimeout(ctx context.Context, timeout time.Duration) (interface{}, error)
Receive(ctx context.Context) (interface{}, error)
ReceiveMessage(ctx context.Context) (*Message, error)
Channel(opts ...ChannelOption) <-chan *Message
Close() error
}
type ChannelOption func(*channelOptions)
type channelOptions struct {
size int
maxInterval int64
}
func WithChannelSize(size int) ChannelOption {
return func(opts *channelOptions) {
opts.size = size
}
}
func WithMaxInterval(maxInterval int64) ChannelOption {
return func(opts *channelOptions) {
opts.maxInterval = maxInterval
}
}
from asynq.
ok seems like there is already a broker interface
https://github.com/hibiken/asynq/blob/master/internal/base/base.go#L715-L755
So we would just need to implement one for every type... eg: SQS, RabbitMQ, PUB SUB etc...
from asynq.
Thanks. broker interface depends on redis pubsub currently.
https://github.com/hibiken/asynq/blob/master/internal/base/base.go#L751
IMO to decouple pub/sub to its own interface. We don't need all the methods
from asynq.
Looking forward to this feature👀
from asynq.
+1
from asynq.
Related Issues (20)
- [FEATURE REQUEST] Separate Consumer from Server HOT 3
- Question: Individual ServerInfo and identifying current server via UUID HOT 2
- [FEATURE REQUEST] Support for dragonfly HOT 1
- How to synchronize task information between asynq and database? HOT 5
- [FEATURE REQUEST] Will your add the TraceId option HOT 1
- [FEATURE REQUEST] Expose method within handler to shutdown server HOT 1
- support other redis libarary? HOT 1
- [FEATURE REQUEST] Ability to modify a task's Payload in middleware
- [FEATURE REQUEST] Task callbacks HOT 1
- [FEATURE REQUEST] Task or Queue broadcasting HOT 2
- [BUG] memory overflow issue
- [FEATURE REQUEST] Add Metadata/Headers Field for Distributed Tracing in asynq.Task HOT 2
- [FEATURE REQUEST] Multiple copies running inside the container
- [BUG] rate.NewSemaphore: type conversion failure (MakeRedisClient error?) HOT 3
- When used together with the grpc service, grpc cannot exit normally. HOT 1
- [FEATURE REQUEST] redis client version compatibility HOT 9
- [FEATURE REQUEST] Globally limit active task number according to task type HOT 1
- [FEATURE REQUEST] Can be persistent with Scheduler/Perodic job, just like we have with task HOT 1
- [BUG] Lease expiration occasionally occurs when dealing with extremely long tasks,log >>> asynq: task lease expired HOT 2
- [FEATURE REQUEST] Is it possible to provide an API to view information about ongoing tasks? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asynq.