netpool test. wip
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 32s
Build and Publish / BuildAndDeploy (push) Successful in 3m2s

This commit is contained in:
matst80
2024-11-21 21:23:38 +01:00
parent 1f7f161e62
commit 5348c33f3b
11 changed files with 140 additions and 89 deletions

View File

@@ -3,6 +3,8 @@ package main
import (
"fmt"
"strings"
"github.com/yudhasubki/netpool"
)
func (id CartId) String() string {
@@ -43,12 +45,13 @@ type RemoteGrain struct {
Host string
}
func NewRemoteGrain(id CartId, host string) (*RemoteGrain, error) {
func NewRemoteGrain(id CartId, host string, pool netpool.Netpooler) *RemoteGrain {
addr := fmt.Sprintf("%s:1337", host)
return &RemoteGrain{
Id: id,
Host: host,
Connection: NewConnection(fmt.Sprintf("%s:1337", host)),
}, nil
Connection: NewConnection(addr, pool),
}
}
func (g *RemoteGrain) HandleMessage(message *Message, isReplay bool) (*FrameWithPayload, error) {