Thanks for the Channel API - it's makes it quite simple to build powerful
functionality.
I came up against a use case which IMHO should "just work" but does not seem
to. I have a class that creates a channel. According to the docs, I can do
the following:
socket = goog.appengine.Channel.open(myInstance); // as long as myInstance
has onopen, onmessage etc. methods.
However, when the onmessage method is called on myInstance, the meaning of "
this" does not apply to myInstance, and it causes errors in onmessage if
there is any reference to this -- the goog.appengine.Channel code seems to
just copy the function pointer with no regard for its scope. Since
goog.appengine.Channel is rather opaque and does not expose much
functionality, there seems to be no benefit for the channel consumer of
making this refer to something within goog.appengine.Channel. I would
suggest modifying goog.appengine.Channel so that this automatically refers
to the object argument passed to .open().
I'm currently using the following workaround, which does the job meanwhile:
socket = channel.open({onopen: goog.bind(this.onOpen, this),
onmessage: goog.bind(this.onMessage, this),
onerror: goog.bind(this.onError, this),
onclose: goog.bind(this.onClose, this)});
--
Itzy
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.