move actor to pkg
Some checks failed
Build and Publish / Metadata (push) Has been cancelled
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled
Build and Publish / BuildAndDeployArm64 (push) Has been cancelled

This commit is contained in:
matst80
2025-10-13 10:29:55 +02:00
parent c6671ceef0
commit 1575b3a829
29 changed files with 584 additions and 654 deletions

View File

@@ -1,6 +1,8 @@
package actor
import "net/http"
import (
"net/http"
)
type GrainPool[V any] interface {
Apply(id uint64, mutation any) (V, error)
@@ -14,12 +16,19 @@ type GrainPool[V any] interface {
GetLocalIds() []uint64
RemoveHost(host string)
IsHealthy() bool
IsKnown(string) bool
Close()
}
// Host abstracts a remote node capable of proxying cart requests.
type Host interface {
AnnounceExpiry(ids []uint64)
Negotiate(otherHosts []string) ([]string, error)
Name() string
Proxy(id uint64, w http.ResponseWriter, r *http.Request) (bool, error)
GetActorIds() []uint64
Close() error
Ping() bool
IsHealthy() bool
AnnounceOwnership(ids []uint64)
}