Re: [google-appengine] Sample for Push Queues

44 views
Skip to first unread message
Message has been deleted

Robert Kluin

unread,
Sep 7, 2011, 1:57:14 AM9/7/11
to google-a...@googlegroups.com
Hi Hariprasath,
If you don't specify an eta or countdown, then the request will be
processed once resources are available to process it.

Tasks are just like any other request, so there really isn't
anything special to show you. Just write a request handler like any
other.


Robert

On Tue, Sep 6, 2011 at 05:46, Hariprasath Mohankumar
<hariprasath...@gmail.com> wrote:
> Hi,
>                   Im new to Task Queues API. Can anyone share with me a
> sample that i can use for running some backgorund process in my application?
> Also I have one more question regarding the push queues. When does the
> execution of the tasks in the queue starts? Does it start immediately after
> a task in added into the queues?
> Thanks,
> Hariprasath Mohankumar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/7zh_OnoYSg0J.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

Message has been deleted

Hariprasath Mohankumar

unread,
Sep 7, 2011, 4:44:56 AM9/7/11
to google-a...@googlegroups.com
Hi Robert,
                           Thanks for your reply. But i found a strange behaiviour, when i add tasks in the queue with the call below,
                         taskqueue.add(url='/autobot', params={'key':game.userXid}, queue_name='autobot') 
the execution of the task is not happening ASYNCHRONOUSLY. the code waits for the task to be completed by executing the logic which i defined in '/autobot' url and then it  moves ahead with the instructions that follow the taskqueue.add( )  function. Is there anything im doing wrong here?. 


Thanks,
Hariprasath Mohankumar

Robert Kluin

unread,
Sep 7, 2011, 9:46:25 AM9/7/11
to google-a...@googlegroups.com
Hi Hariprasath,
Is this on the dev server or appspot? You probably need to provide
a little more code context as well.


Robert

On Wed, Sep 7, 2011 at 03:41, Hariprasath Mohankumar
<hariprasath...@gmail.com> wrote:
> Hi Robert,
>                            Thanks for your reply. But i found a strange
> behaiviour, when i add tasks in the queue with the call below,
>                          taskqueue.add(url='/autobot',
> params={'key':game.userXid}, queue_name='autobot')
> the execution of the task is not happening ASYNCHRONOUSLY. the code waits
> for the task to be completed by executing the logic which i defined in

> '/autobot' url and is not moving ahead with the instructions that follow the
> taskqueue.add( )  function. Is there anything im doing wrong here.


>
> Thanks,
> Hariprasath Mohankumar
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/google-appengine/-/5qw1CmOMklIJ.

Message has been deleted

Hariprasath Mohankumar

unread,
Sep 7, 2011, 11:21:10 AM9/7/11
to google-a...@googlegroups.com
Hi Robert,
                          this is happening in the dev server.  The code is as follows.


class botinitiate(webapp.RequestHandler):
  def get(self):

        # some more statements here
        template_values = {'token': token,
                           'me': user.user_id()
                          }

        taskqueue.add(url='/autobot', params={'key':game_key},queue_name='autobot')    #creating the task and adding it to the queue
        path = os.path.join(os.path.dirname(__file__), 'index.html')
        self.response.out.write(template.render(path, template_values))


class autobot(webapp.RequestHandler):
    def post(self):
                    #      task logic goes here



application = webapp.WSGIApplication([('/botinitiate',botinitiate),('/autobot',autobot)],debug=True)


def main():
  run_wsgi_app(application)

if __name__ == "__main__":
  main()


when i add the task using taskqueue.add() function it adds the task to the queue and it waits for the task to complete and then it executes the following statements after finishing the task. Am i doing anything wrong here? Can you provide me a code sample that does this functionality?
Reply all
Reply to author
Forward
0 new messages