--
You received this message because you are subscribed to the Google Groups "Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capnproto+...@googlegroups.com.
Visit this group at http://groups.google.com/group/capnproto.
Side note: a future is just a channel that's guaranteed to be used exactly once, so it's hard to see how the lack of futures in go could make anything fundamentally harder.
--
Hi Ross,Sorry, the constraint is definitely (a). By "messages" I meant "call messages", saying nothing about returns. We definitely don't want call/returns to be FIFO -- it's in fact a common pattern for a call to hang for a long period while other calls continue to be serviced.The ordering of *starts* is important, though, in order to support interfaces like:interface Stream {write @0 (data :Data);}Here, the caller might issue several write() calls, but they need to arrive in-order.
I am not very experienced with Go, but I would think that the best way to implement this in Go would be for all calls to a particular object to arrive on a channel. The object pulls calls from the channel and calls the appropriate method, passing it the parameters as well as a return channel. Returns would then be accomplished by writing to the return channel, which could happen immediately or in the future.This way, by default there is one thread per object and the object implementation need not worry about synchronization. But, if the object wants to perform some task concurrently, it can start a goroutine which performs some long-running task then writes to the return channel.Thoughts?-Kenton
Here's what I had in mind: https://gist.github.com/zombiezen/2878a6085b48486d4ccf