Creating Pull Tasks

Once you have created a pull queue , you can create tasks and add them to the queue.

First you need the name of the queue, which is defined in queue.yaml . Then you set the Task method to PULL . The following example puts tasks in a pull queue named pull-queue :

  from 
  
 google.appengine.api 
  
 import 
 taskqueue 
 q 
 = 
 taskqueue 
 . 
 Queue 
 ( 
 'pull-queue' 
 ) 
 tasks 
 = 
 [] 
 payload_str 
 = 
 'hello world' 
 tasks 
 . 
 append 
 ( 
 taskqueue 
 . 
 Task 
 ( 
 payload 
 = 
 payload_str 
 , 
 method 
 = 
 'PULL' 
 )) 
 q 
 . 
 add 
 ( 
 tasks 
 ) 
 

What's next

Design a Mobile Site
View Site in Mobile | Classic
Share by: