channel-api

Debugging Channel API Appengine

血红的双手。 提交于 2019-12-12 03:57:17
问题 I'm using the appengine channel api(with deferred tasks) but it doesn't seem to be working. Here's my server code in a gist: Class Handler(webapp2.RequestHandler): def get(self): path = jinja_environment.get_template('templates/new_console.html') token = channel.create_channel('some_key') # Deferring the task. deferred.defer(_task, token) args = {} args['token'] = token self.response.out.write(path.render(args)) def _task(token): FeedbackThreadModel(id='id').put() time.sleep(60) channel.send

Displaying images in html5 canvas from binary data

故事扮演 提交于 2019-12-12 02:29:57
问题 I am trying to send an image from a canvas through the google app engine channel api to another client who will then display the same image. The message is being received but it is not displaying the image. On the sending side: var image = context.getImageData(0, 0, imageCanvas.width, imageCanvas.height); var buffer = new ArrayBuffer(image.data.length); var bytes = new Uint8Array(buffer); for (var i=0; i<bytes.length; i++) { bytes[i] = image.data[i]; } sendMessage({image: buffer}); Rendering

Use Channel API to receive messages from task in Task Queue

早过忘川 提交于 2019-12-11 11:24:38
问题 I am trying to figure out the Task Queue and Channel API. I have a process that is expected to run >60 seconds added to the task queue when the user submits a form. This process should then send messages through the channel api as it executes. Of coarse I cannot seem to make this work. Can anyone tell me why the SendMessagesHandler is not able to send messages to the client side javascript? Or perhaps the client side javascript is not receiving properly? Also, I do not see the logging

GWT & channel API

微笑、不失礼 提交于 2019-12-11 07:38:15
问题 Anyone have experience with appengine channel api with GWT? I have been following the BRIEF "How-to" provided with the googlecode . My question is how do we get the channelKey(token variable in the code below) in GWT? I am assuming you must use an RPC to get the channelKey from the server for each session. Is this correct? I was hoping you could just use the channelId, but that does not appear to be the case. Also best answer will be award to anyone who can provide a working example code for

GAE: Channel API: ApplicationError: 1

雨燕双飞 提交于 2019-12-11 07:25:15
问题 GAE seems to throw an ApplicationError: 1 on some code that has worked before. It could be a general GEA problem or some version upgrade issue as the code last was used a while ago. How would I debug that error? ApplicationError: 1 (/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py:1552) Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__ rv =

Sending a data uri via google app engine channel api

感情迁移 提交于 2019-12-11 03:18:37
问题 I'm trying to send a data uri of an image that has been taken from a canvas element to another client via the channel api. This is my javascript: var pictData = imageCanvas.toDataURL("image/png"); sendPictData(pictData); function sendPictData(pictData){ dataToSend = encodeURIComponent(pictData); sendMessage({type: 'blackboardBackground', image: dataToSend }); } function sendMessage(message){ var msgString = JSON.stringify(message); path = '/lessonarea/message?r={{ key }}' + '&u={{ me }}'; var

Can Google App Engine Channels be reused?

六眼飞鱼酱① 提交于 2019-12-10 15:41:19
问题 If a client disconnects from a Google App Engine channel, then can the service that created the channel reuse the corresponding token for another client? I realize that there have been previous questions on the best way of "pooling channels" implicit in which is the idea that this is possible. However, I have also seen opinions that suggest that this is not possible. I would appreciate it if someone could clarify this point. 回答1: After about a week of debugging channel reuse, I upgraded

working with new channel creation limits

北城余情 提交于 2019-12-08 02:26:04
问题 Google app engine seems to have recently made a huge decrease in free quotas for channel creation from 8640 to 100 per day. I would appreciate some suggestions for optimizing channel creation, for a hobby project where I am unwilling to use the paid plans. It is specifically mentioned in the docs that there can be only one client per channel ID. It would help if there were a way around this, even if it were only for multiple clients on one computer (such as multiple tabs) It occurred to me I

How do I turn off the console logging in App Engine Channel API?

十年热恋 提交于 2019-12-07 20:13:24
问题 I've implemented the Channel API w/ persistence. When I make a channel and connect the socket (this is on the real app, not the local dev_appserver), Firebug goes nuts with log messages. I want to turn these off so I can see my OWN logs but cant find any documentation on how to disable the Channel API console logging. one thing I'm probably doing differently than most is that I'm connecting cross-domain... which the Channel API supports (note the first message in the stream... if you can view

working with new channel creation limits

∥☆過路亽.° 提交于 2019-12-06 10:56:40
Google app engine seems to have recently made a huge decrease in free quotas for channel creation from 8640 to 100 per day. I would appreciate some suggestions for optimizing channel creation, for a hobby project where I am unwilling to use the paid plans. It is specifically mentioned in the docs that there can be only one client per channel ID. It would help if there were a way around this, even if it were only for multiple clients on one computer (such as multiple tabs) It occurred to me I might be able to simulate channel functionality by repeatedly sending XHR requests to the server to