major changes
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 43s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m43s

This commit is contained in:
matst80
2025-12-04 20:56:54 +01:00
parent 6d5358b53b
commit f67eeb3c49
21 changed files with 572 additions and 242 deletions

View File

@@ -15,29 +15,29 @@ type MutationResult[V any] struct {
type GrainPool[V any] interface {
Apply(ctx context.Context, id uint64, mutation ...proto.Message) (*MutationResult[V], error)
Get(ctx context.Context, id uint64) (V, error)
OwnerHost(id uint64) (Host, bool)
Get(ctx context.Context, id uint64) (*V, error)
OwnerHost(id uint64) (Host[V], bool)
Hostname() string
TakeOwnership(id uint64)
HandleOwnershipChange(host string, ids []uint64) error
HandleRemoteExpiry(host string, ids []uint64) error
Negotiate(otherHosts []string)
GetLocalIds() []uint64
IsHealthy() bool
Close()
IsKnown(string) bool
RemoveHost(host string)
AddRemoteHost(host string)
IsHealthy() bool
IsKnown(string) bool
Close()
}
// Host abstracts a remote node capable of proxying cart requests.
type Host interface {
type Host[V any] interface {
AnnounceExpiry(ids []uint64)
Negotiate(otherHosts []string) ([]string, error)
Name() string
Proxy(id uint64, w http.ResponseWriter, r *http.Request, customBody io.Reader) (bool, error)
Apply(ctx context.Context, id uint64, mutation ...proto.Message) (bool, error)
Get(ctx context.Context, id uint64, grain any) error
Apply(ctx context.Context, id uint64, mutation ...proto.Message) (*MutationResult[V], error)
Get(ctx context.Context, id uint64) (*V, error)
GetActorIds() []uint64
Close() error
Ping() bool