github.com/blend/go-sdk@v1.20240719.1/async/constants.go (about) 1 /* 2 3 Copyright (c) 2024 - Present. Blend Labs, Inc. All rights reserved 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file. 5 6 */ 7 8 package async 9 10 import ( 11 "time" 12 13 "github.com/blend/go-sdk/ex" 14 ) 15 16 // Latch states 17 const ( 18 LatchStopped int32 = 0 19 LatchStarting int32 = 1 20 LatchResuming int32 = 2 21 LatchStarted int32 = 3 22 LatchActive int32 = 4 23 LatchPausing int32 = 5 24 LatchPaused int32 = 6 25 LatchStopping int32 = 7 26 ) 27 28 // Constants 29 const ( 30 DefaultQueueMaxWork = 1 << 10 31 DefaultInterval = 500 * time.Millisecond 32 DefaultShutdownGracePeriod = 10 * time.Second 33 ) 34 35 // Errors 36 var ( 37 ErrCannotStart ex.Class = "cannot start; already started" 38 ErrCannotStop ex.Class = "cannot stop; already stopped" 39 ErrCannotCancel ex.Class = "cannot cancel; already canceled" 40 )