|
Egon |
at Jan 15, 2014 at 10:04 am
|
⇧ |
| |
On Wednesday, January 15, 2014 11:50:02 AM UTC+2, Henrik Johansson wrote:
I think the dropping case(s) lifo/fifo is a pretty natural extension to
the current channels.
It provides a bit more control of the behavior without sacrificing easy
and nice way that channels are used.
1. Unbuffered channels - Rendezvous
2. Buffered, blocking
3. Buffered non-blocking - drop newest
4. Buffered non-blocking - drop oldest
And sure these can always be implemented (everything can) but that does
not make it a bad evolution of the channels.
...and then out of order delivery, then prioritized delivery, then UDP
style channels that can accept dropped messages... Where should the line be
drawn?
If it goes into the language it must have a lot of use-cases; otherwise
it's better to implement it in a library. If something is really necessary
in the language you should be able to demonstrate it:
i.e. a list of 5-15 practical usefulness examples would be a good starting
point, and then a pro/con analysis for adding that. And not just some
examples that can be handled by a library... but by examples that will be
often needed in many variations.
+ egon
On Wed, Jan 15, 2014 at 10:32 AM, Peter Bourgon <pe...@bourgon.org<javascript:>
wrote:
On Wed, Jan 15, 2014 at 9:11 AM, Henrik Johansson <dahan...@gmail.com<javascript:>>
wrote:
What queue? I am talking about the channels underlying queue.
The whole point is to modify the behavior of the channel. If I can do it via
a library, fine but it is not possible right?
There would need to be all sorts of intermediary buffers and a number of
channels. This can easily be implemented in a library, sure but why not have
it in the native channels? There is already the distinction between buffered
and non-buffered channels that you have to consider actively when you code.
This is no different.
I think it belongs in the language but there could be implementation details
too destructive to make it worth it of course.
Language primitives like channels are building blocks, not prepackaged
solutions to classes of problems.
Systems with the semantics you describe are straightforward to
implement using channels as they exist today.
http://play.golang.org/p/JyTXqkBxVX(Disclaimer: not thoroughly tested.)
On Jan 15, 2014 3:02 AM, "minux" <minu...@gmail.com <javascript:>>
wrote:
On Tue, Jan 14, 2014 at 8:20 AM, Henrik Johansson <dahan...@gmail.com<javascript:>
wrote:
For networking I would go for something else at least until/if net
chans
come back.
My point is simply that some of these things may belong in the queue.
but the queue doesn't belong to the language, it could (and should) be
implemented as
a package.
Maybe you have a windowing system where communication is distributed
via
channels and you may want to coalesce some events transparently,
maybe some events are more important?
All these problems should be fixed in user programs, not on the Go
language level.
It is just food for thought and I am sure there must have been much
discussion when channels were first conceived.
--
You received this message because you are subscribed to the Google
Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send
an
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to golang-nuts...@googlegroups.com <javascript:>.
For more options, visit
https://groups.google.com/groups/opt_out.--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.