| 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 memory | 5 package memory |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "net/http" | 10 "net/http" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 closed int32 | 189 closed int32 |
| 190 anony tq.AnonymousQueueData | 190 anony tq.AnonymousQueueData |
| 191 parent *taskQueueData | 191 parent *taskQueueData |
| 192 } | 192 } |
| 193 | 193 |
| 194 var _ interface { | 194 var _ interface { |
| 195 memContextObj | 195 memContextObj |
| 196 tq.Testable | 196 tq.Testable |
| 197 } = (*txnTaskQueueData)(nil) | 197 } = (*txnTaskQueueData)(nil) |
| 198 | 198 |
| 199 func (t *txnTaskQueueData) canApplyTxn(obj memContextObj) bool { return
false } | 199 func (t *txnTaskQueueData) canApplyTxn(obj memContextObj) bool { return false } |
| 200 func (t *txnTaskQueueData) applyTxn(context.Context, memContextObj) { panic("
impossible") } | 200 func (t *txnTaskQueueData) applyTxn(context.Context, memContextObj) { |
| 201 func (t *txnTaskQueueData) mkTxn(*ds.TransactionOptions) memContextObj { panic("
impossible") } | 201 » impossible(fmt.Errorf("cannot apply nested transaction")) |
| 202 } |
| 203 func (t *txnTaskQueueData) mkTxn(*ds.TransactionOptions) memContextObj { |
| 204 » impossible(fmt.Errorf("cannot start nested transaction")) |
| 205 » return nil |
| 206 } |
| 202 | 207 |
| 203 func (t *txnTaskQueueData) endTxn() { | 208 func (t *txnTaskQueueData) endTxn() { |
| 204 if atomic.LoadInt32(&t.closed) == 1 { | 209 if atomic.LoadInt32(&t.closed) == 1 { |
| 205 panic("cannot end transaction twice") | 210 panic("cannot end transaction twice") |
| 206 } | 211 } |
| 207 atomic.StoreInt32(&t.closed, 1) | 212 atomic.StoreInt32(&t.closed, 1) |
| 208 } | 213 } |
| 209 | 214 |
| 210 func (t *txnTaskQueueData) ResetTasks() { | 215 func (t *txnTaskQueueData) ResetTasks() { |
| 211 t.Lock() | 216 t.Lock() |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 return t.parent.GetTombstonedTasks() | 252 return t.parent.GetTombstonedTasks() |
| 248 } | 253 } |
| 249 | 254 |
| 250 func (t *txnTaskQueueData) GetScheduledTasks() tq.QueueData { | 255 func (t *txnTaskQueueData) GetScheduledTasks() tq.QueueData { |
| 251 return t.parent.GetScheduledTasks() | 256 return t.parent.GetScheduledTasks() |
| 252 } | 257 } |
| 253 | 258 |
| 254 func (t *txnTaskQueueData) CreateQueue(queueName string) { | 259 func (t *txnTaskQueueData) CreateQueue(queueName string) { |
| 255 t.parent.CreateQueue(queueName) | 260 t.parent.CreateQueue(queueName) |
| 256 } | 261 } |
| OLD | NEW |