Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: service/taskqueue/raw_interface.go

Issue 2512093002: Add support for Pull Queues to prod implementation. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package taskqueue 5 package taskqueue
6 6
7 // RawCB is a simple callback for RawInterface.DeleteMulti, getting the error 7 // RawCB is a simple callback for RawInterface.DeleteMulti, getting the error
8 // for the attempted deletion. 8 // for the attempted deletion.
9 type RawCB func(error) 9 type RawCB func(error)
10 10
11 // RawTaskCB is the callback for RawInterface.AddMulti, getting the added task 11 // RawTaskCB is the callback for RawInterface.AddMulti, getting the added task
12 // and an error. 12 // and an error.
13 type RawTaskCB func(*Task, error) 13 type RawTaskCB func(*Task, error)
14 14
15 // RawStatsCB is the callback for RawInterface.Stats. It takes the statistics 15 // RawStatsCB is the callback for RawInterface.Stats. It takes the statistics
16 // object, as well as an error (e.g. in case the queue doesn't exist). 16 // object, as well as an error (e.g. in case the queue doesn't exist).
17 type RawStatsCB func(*Statistics, error) 17 type RawStatsCB func(*Statistics, error)
18 18
19 // RawInterface is the full interface to the Task Queue service. 19 // RawInterface is the full interface to the Task Queue service.
20 type RawInterface interface { 20 type RawInterface interface {
21 // AddMulti adds multiple tasks to the given queue, calling cb for each item. 21 // AddMulti adds multiple tasks to the given queue, calling cb for each item.
22 // 22 //
23 // The task passed to the callback function will have all the default va lues 23 // The task passed to the callback function will have all the default va lues
24 // filled in, and will have the Name field populated, if the input task was 24 // filled in, and will have the Name field populated, if the input task was
25 // anonymous (e.g. the Name field was blank). 25 // anonymous (e.g. the Name field was blank).
26 AddMulti(tasks []*Task, queueName string, cb RawTaskCB) error 26 AddMulti(tasks []*Task, queueName string, cb RawTaskCB) error
27 DeleteMulti(tasks []*Task, queueName string, cb RawCB) error 27 DeleteMulti(tasks []*Task, queueName string, cb RawCB) error
28 28
29 Lease(maxTasks int, queueName string, leaseTime int) ([]*Task, error)
30 LeaseByTag(maxTasks int, queueName string, leaseTime int, tag string) ([ ]*Task, error)
31 ModifyLease(task *Task, queueName string, leaseTime int) error
32
29 Purge(queueName string) error 33 Purge(queueName string) error
30 34
31 Stats(queueNames []string, cb RawStatsCB) error 35 Stats(queueNames []string, cb RawStatsCB) error
32 36
33 GetTestable() Testable 37 GetTestable() Testable
34 } 38 }
OLDNEW
« service/taskqueue/interface.go ('K') | « service/taskqueue/interface.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698