abstract workers

This commit is contained in:
Barak Michener 2020-12-04 12:34:41 -08:00
parent 51f92278ac
commit efd3d65269
5 changed files with 88 additions and 67 deletions

View file

@ -3,7 +3,7 @@ package main
import (
"context"
"github.com/barakmich/go_raylet/ray_rpc"
"github.com/barakmich/tinkerbell/ray_rpc"
"go.uber.org/zap"
)
@ -55,11 +55,17 @@ func (r *Raylet) Schedule(_ context.Context, task *ray_rpc.ClientTask) (*ray_rpc
}
func (r *Raylet) Workstream(conn WorkstreamConnection) error {
return r.Workers.Workstream(conn)
worker := &SimpleWorker{
workChan: make(chan *ray_rpc.Work),
clientConn: conn,
pool: wp,
}
r.Workers.Register(worker)
err := worker.Run()
r.Workers.Deregister(worker)
return err
}
//func (r *Raylet) Workstream()
func NewMemRaylet() *Raylet {
store := NewMemObjectStore()
return &Raylet{