Question

The following Google reference page says "No error is returned if the message cannot be delivered": https://developers.google.com/appengine/docs/python/channel/functions

In contrast, Socket.IO has ack callbacks on messages so you can handler success/error: http://socket.io/#how-to-use

Does anyone suggest a solution to achieve the same goal using the Channel API? Otherwise, Channel API is only useful for volatile messaging. And I would rather not reinvent the wheel to try to achieve this effect by writing a transactional system for messaging.

Was it helpful?

Solution

The bad news is that the Channel API is unidirectional and non blocking, so there is no way to wait for a response or specify a callback. However...

The Elements of the Channel API section of the Channel Python API Overview says the role of the server includes "Receiving update messages from clients via HTTP requests". Therefore by sending a unique message identifier in each channel message, clients could acknowledge them asynchronously via HTTP. The server could re-send the unacknowledged messages after each one times out.

Maybe it's still bad news, because this suggestion looks too much like your "writing a transactional system for messaging" although the asynchronous part would be better that synchronous socket.io.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top