This commit is contained in:
Lukas Wurzinger 2024-12-07 23:54:44 +01:00
parent bd4b25ea88
commit 1b91300ebb

View file

@ -22,8 +22,8 @@ const (
AppendOpenFlags = os.O_APPEND | os.O_CREATE | os.O_WRONLY AppendOpenFlags = os.O_APPEND | os.O_CREATE | os.O_WRONLY
) )
// Key defines the set of types that can be used as keys in the // Key defines the set of types that can be used as keys in the Scheduler.
// UploadScheduler. It can be any integer type or a string. // It can be any integer or string type.
type Key interface { type Key interface {
constraints.Integer | ~string constraints.Integer | ~string
} }
@ -49,8 +49,8 @@ type scheduler[K Key] struct {
m *haxmap.Map[K, upload] m *haxmap.Map[K, upload]
} }
// NewScheduler creates a new UploadScheduler instance. It returns an // NewScheduler creates a new Scheduler. It returns a Scheduler configured to
// UploadScheduler configured to manage uploads keyed by the specified type. // manage uploads keyed by the specified type.
func NewScheduler[K Key]() Scheduler[K] { func NewScheduler[K Key]() Scheduler[K] {
return scheduler[K]{ return scheduler[K]{
m: haxmap.New[K, upload](), m: haxmap.New[K, upload](),