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

Unified Diff: go/src/infra/gae/libs/gae/taskqueue.go

Issue 1235563007: Simplify taskqueue interface. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: fix test Created 5 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/taskqueue_test.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/taskqueue.go
diff --git a/go/src/infra/gae/libs/gae/taskqueue.go b/go/src/infra/gae/libs/gae/taskqueue.go
index aa4de3d9d72fc18858977d341b5f3382faf7a206..ab25eefcc4f342d2bef3554533dd1b0f55285a27 100644
--- a/go/src/infra/gae/libs/gae/taskqueue.go
+++ b/go/src/infra/gae/libs/gae/taskqueue.go
@@ -8,50 +8,23 @@ import (
"golang.org/x/net/context"
)
-// TQSingleReadWriter allows you to add or delete a single Task from a queue.
-// See appengine.taskqueue.
-type TQSingleReadWriter interface {
+// TaskQueue is the full interface to the Task Queue service.
+type TaskQueue interface {
Add(task *TQTask, queueName string) (*TQTask, error)
Delete(task *TQTask, queueName string) error
-}
-
-// TQMultiReadWriter allows you to add or delete a batch of Tasks from a queue.
-// See appengine.taskqueue.
-type TQMultiReadWriter interface {
- TQSingleReadWriter
AddMulti(tasks []*TQTask, queueName string) ([]*TQTask, error)
DeleteMulti(tasks []*TQTask, queueName string) error
-}
-// TQLeaser allows you to lease tasks from a Pull queue.
-// See appengine.taskqueue.
-type TQLeaser interface {
Lease(maxTasks int, queueName string, leaseTime int) ([]*TQTask, error)
LeaseByTag(maxTasks int, queueName string, leaseTime int, tag string) ([]*TQTask, error)
ModifyLease(task *TQTask, queueName string, leaseTime int) error
-}
-// TQPurger allows you to drain a queue without processing it. See
-// appengine.taskqueue.
-type TQPurger interface {
Purge(queueName string) error
-}
-// TQStatter allows you to obtain semi-realtime stats on the current state of
-// a queue. See appengine.taskqueue.
-type TQStatter interface {
QueueStats(queueNames []string) ([]TQStatistics, error)
}
-// TaskQueue is the full interface to the Task Queue service.
-type TaskQueue interface {
- TQMultiReadWriter
- TQLeaser
- TQPurger
- TQStatter
-}
-
// TQFactory is the function signature for factory methods compatible with
// SetTQFactory.
type TQFactory func(context.Context) TaskQueue
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/taskqueue_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698