You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing in particular that I've found to be a little annoying to deal with is the lack of type-safety. You can put any byte slice in to jobs.Create() or Send() which means potential run-time errors and no IDE support. You also have to manually deal with serialization on both the caller and receiver side for every single queue. I had the same issue with asynq.
Adding type-safety is possible. I put together a very basic POC that I believe will work. Each queue would have to be declared with the type you intend to receive and process.
Is this something you would be interested in? If not, since it's a rather large refactor, I completely understand.
The text was updated successfully, but these errors were encountered:
I thought about this when designing the queue, and I ended up using a byte slice because I couldn't figure out beforehand how people would use this. It's always possible to delegate much of the (de)serialization to helpers.
But I think it could be interesting to explore this from an approach of not changing the existing implementation, but instead adding it on top, like a TypedQueue or something like that, with essentially the same interface. Then people would be free to choose from the low-level interface or the higher-level generics version.
One thing in particular that I've found to be a little annoying to deal with is the lack of type-safety. You can put any byte slice in to
jobs.Create()
orSend()
which means potential run-time errors and no IDE support. You also have to manually deal with serialization on both the caller and receiver side for every single queue. I had the same issue with asynq.Adding type-safety is possible. I put together a very basic POC that I believe will work. Each queue would have to be declared with the type you intend to receive and process.
Is this something you would be interested in? If not, since it's a rather large refactor, I completely understand.
The text was updated successfully, but these errors were encountered: