OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package taskqueue | 5 package taskqueue |
6 | 6 |
7 import ( | 7 import ( |
8 "github.com/luci/luci-go/common/errors" | 8 "github.com/luci/luci-go/common/errors" |
9 ) | 9 ) |
10 | 10 |
11 type taskqueueImpl struct{ RawInterface } | 11 type taskqueueImpl struct{ RawInterface } |
12 | 12 |
13 func (t *taskqueueImpl) NewTask(path string) *Task { | |
14 return &Task{Path: path} | |
15 } | |
16 | |
17 func (t *taskqueueImpl) Add(task *Task, queueName string) error { | 13 func (t *taskqueueImpl) Add(task *Task, queueName string) error { |
18 return errors.SingleError(t.AddMulti([]*Task{task}, queueName)) | 14 return errors.SingleError(t.AddMulti([]*Task{task}, queueName)) |
19 } | 15 } |
20 | 16 |
21 func (t *taskqueueImpl) Delete(task *Task, queueName string) error { | 17 func (t *taskqueueImpl) Delete(task *Task, queueName string) error { |
22 return errors.SingleError(t.DeleteMulti([]*Task{task}, queueName)) | 18 return errors.SingleError(t.DeleteMulti([]*Task{task}, queueName)) |
23 } | 19 } |
24 | 20 |
25 func (t *taskqueueImpl) AddMulti(tasks []*Task, queueName string) error { | 21 func (t *taskqueueImpl) AddMulti(tasks []*Task, queueName string) error { |
26 lme := errors.NewLazyMultiError(len(tasks)) | 22 lme := errors.NewLazyMultiError(len(tasks)) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 68 |
73 func (t *taskqueueImpl) Raw() RawInterface { | 69 func (t *taskqueueImpl) Raw() RawInterface { |
74 return t.RawInterface | 70 return t.RawInterface |
75 } | 71 } |
76 | 72 |
77 func (t *taskqueueImpl) Testable() Testable { | 73 func (t *taskqueueImpl) Testable() Testable { |
78 return t.RawInterface.Testable() | 74 return t.RawInterface.Testable() |
79 } | 75 } |
80 | 76 |
81 var _ Interface = (*taskqueueImpl)(nil) | 77 var _ Interface = (*taskqueueImpl)(nil) |
OLD | NEW |