engine, lang: core: world: Split out the scheduler interface

This commit is contained in:
James Shubin
2025-03-18 03:26:59 -04:00
parent c853e24ded
commit 59c33a354c
2 changed files with 19 additions and 4 deletions

View File

@@ -44,8 +44,6 @@ type World interface { // TODO: is there a better name for this interface?
ResWorld
Scheduler(namespace string, opts ...scheduler.Option) (*scheduler.Result, error)
// URI returns the current FS URI.
// TODO: Can we improve this API or deprecate it entirely?
URI() string
@@ -84,6 +82,13 @@ type ResWorld interface {
ResCollect(ctx context.Context, hostnameFilter, kindFilter []string) ([]Res, error)
}
// SchedulerWorld is an interface that has to do with distributed scheduling.
// XXX: This should be abstracted to remove the etcd specific types if possible.
type SchedulerWorld interface {
// Scheduler runs a distributed scheduler.
Scheduler(namespace string, opts ...scheduler.Option) (*scheduler.Result, error)
}
// EtcdWorld is a world interface that should be implemented if the world
// backend is implementing etcd, and if it supports dynamically resizing things.
// TODO: In theory we could generalize this to support other backends, but lets