Reputation: 6029
Is it possible to use Google Appengine Channel API with DART language? It would be great if you can point to some examples and pitfalls if any.
Upvotes: 1
Views: 683
Reputation: 5030
A guy from the Dart team ported a client library to Dart: http://code.google.com/p/gae-channel-api-dart/
Upvotes: 3
Reputation: 11171
The solution I've recommended is to use the Channel API in JS to open a socket and forward all messages via a postMessage or a custom event, and receive them in Dart.
I'm not sure if any generic solution has been open sourced, but it should be fairly trivial to do, and doesn't require general JS-interop to work.
edit: clarified
edit 2:
FYI: I just published a library to do exactly this. I hope it works for you!
http://code.google.com/p/gae-channel-api-dart/
Upvotes: 5
Reputation: 80340
The JS code of the Channel API is proprietary and there is no "source" (well there is but good luck reverse-engineering that). Google does this on purpose, so that they can change the Channels underlying protocol without messy upgrade/deprecation process.
So if you follow @Shannon's suggestion, the rewritten code is likely to stop working at some point in the future and you will need to repeat the process of reverse-engineering the Channels JS code.
A better solution would be to call Channels API JS code from Dart, but at the moment Darts support for calling JS is rudimentary, but is seems that they are already started working on improving it.
Upvotes: 3