github.com/kubeflow/training-operator@v1.7.0/pkg/common/util/fake_workqueue.go (about) 1 // Copyright 2021 The Kubeflow Authors 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License 14 15 package util 16 17 import "time" 18 19 // FakeWorkQueue implements RateLimitingInterface but actually does nothing. 20 type FakeWorkQueue struct{} 21 22 // Add WorkQueue Add method 23 func (f *FakeWorkQueue) Add(item interface{}) {} 24 25 // Len WorkQueue Len method 26 func (f *FakeWorkQueue) Len() int { return 0 } 27 28 // Get WorkQueue Get method 29 func (f *FakeWorkQueue) Get() (item interface{}, shutdown bool) { return nil, false } 30 31 // Done WorkQueue Done method 32 func (f *FakeWorkQueue) Done(item interface{}) {} 33 34 // ShutDown WorkQueue ShutDown method 35 func (f *FakeWorkQueue) ShutDown() {} 36 37 // ShutDown WorkQueue ShutDownWithDrain method 38 func (f *FakeWorkQueue) ShutDownWithDrain() {} 39 40 // ShuttingDown WorkQueue ShuttingDown method 41 func (f *FakeWorkQueue) ShuttingDown() bool { return true } 42 43 // AddAfter WorkQueue AddAfter method 44 func (f *FakeWorkQueue) AddAfter(item interface{}, duration time.Duration) {} 45 46 // AddRateLimited WorkQueue AddRateLimited method 47 func (f *FakeWorkQueue) AddRateLimited(item interface{}) {} 48 49 // Forget WorkQueue Forget method 50 func (f *FakeWorkQueue) Forget(item interface{}) {} 51 52 // NumRequeues WorkQueue NumRequeues method 53 func (f *FakeWorkQueue) NumRequeues(item interface{}) int { return 0 }