feat: build wahrwelt A/D toolkit
This commit is contained in:
1 parent
303438d206
commit
653924d8c6
564 files changed
+36310
-49998
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package queue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrQueueFull = errors.New("очередь заданий заполнена")
|
||||
)
|
||||
|
||||
type Type string
|
||||
|
||||
func (t Type) String() string {
|
||||
return string(t)
|
||||
}
|
||||
|
||||
const (
|
||||
TypeSimple Type = "simple"
|
||||
TypeEndless Type = "endless"
|
||||
)
|
||||
|
||||
type Factory interface {
|
||||
Create(maxJobs int) Queue
|
||||
Type() Type
|
||||
}
|
||||
|
||||
type Queue interface {
|
||||
Start(context.Context)
|
||||
Add(*Job) error
|
||||
Results() <-chan *Output
|
||||
Type() Type
|
||||
Size() int
|
||||
|
||||
fmt.Stringer
|
||||
}
|
||||
Reference in new issue
Block a user