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

Unified Diff: service/taskqueue/raw_interface.go

Issue 1270063003: Make the rest of the services have a similar raw/user interface structure. (Closed) Base URL: https://github.com/luci/gae.git@add_datastore
Patch Set: address comments Created 5 years, 4 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 | « service/taskqueue/interface.go ('k') | service/taskqueue/taskqueue.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: service/taskqueue/raw_interface.go
diff --git a/service/taskqueue/raw_interface.go b/service/taskqueue/raw_interface.go
new file mode 100644
index 0000000000000000000000000000000000000000..700c1a8c20f8a91866c64e3b8742d781fa0e3ce8
--- /dev/null
+++ b/service/taskqueue/raw_interface.go
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package taskqueue
+
+// RawCB is a simple callback for RawInterface.DeleteMulti, getting the error
+// for the attempted deletion.
+type RawCB func(error)
+
+// RawTaskCB is the callback for RawInterface.AddMulti, getting the added task
+// and an error.
+type RawTaskCB func(*Task, error)
+
+// RawStatsCB is the callback for RawInterface.Stats. It takes the statistics
+// object, as well as an error (e.g. in case the queue doesn't exist).
+type RawStatsCB func(*Statistics, error)
+
+// RawInterface is the full interface to the Task Queue service.
+type RawInterface interface {
+ // AddMulti adds multiple tasks to the given queue, calling cb for each item.
+ //
+ // The task passed to the callback function will have all the default values
+ // filled in, and will have the Name field populated, if the input task was
+ // anonymous (e.g. the Name field was blank).
+ AddMulti(tasks []*Task, queueName string, cb RawTaskCB) error
+ DeleteMulti(tasks []*Task, queueName string, cb RawCB) error
+
+ Purge(queueName string) error
+
+ Stats(queueNames []string, cb RawStatsCB) error
+}
« no previous file with comments | « service/taskqueue/interface.go ('k') | service/taskqueue/taskqueue.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698