-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up Queue Companion Objects #2280
Comments
That's because you can only create a So, if we move constructors to |
Okay. In discussion in #2242 @jdegoes and @regiskuckaertz seemed to think the current situation was less than ideal and want to change it along these lines. |
It makes sense to move them for consistency but no need to duplicate them since they will have the exact same types. We can add in the package object It's actually how it was initially but this PR made it the way it is now. |
Got it. You are definitely the expert here. Could you have constructors that create queues that are more polymorphic, like that write a value to the console every time a value is offered to them or have a fixed delay every time a value is taken? Or is the idea that you would create "normal" queues and then apply combinators to generate the more polymorphic ones? |
Yeah I think it is. We could use an alias for the time being and split it if there's a need later. |
One thing we might want to think about here is binary compatibility. If we have companion objects for |
Just to add my 2 cents, separating the alias into 2 objects in future wouldn't strike me as a breaking change, but an implementation detail. |
@serragnoli I totally agree with you from a subjective perspective, but my question is more whether it would be binary compatible or not. |
The contract we have for ZIO & family:
This takes effort to maintain, unlike earlier encodings, but it has good user-experience and is very predictable. |
Okay, my bad, we actually have similar cases with I'll do this one. |
Right now
ZQueue
describes the most polymorphic form of aQueue
but doesn't have a companion object and all of the methods that would normally be on a companion object are instead onQueue
. This is confusing and inconsistent with other ZIO data types.We should rename the existing
Queue
object toZQueue
and move it into the existingZQueue.scala
file. Then we should create a newQueue
object similar to what we have forUIO
or other type aliases that delegates to the implementations in theZQueue
object.The text was updated successfully, but these errors were encountered: