connect if not connected
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m53s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m53s
This commit is contained in:
12
rpc-pool.go
12
rpc-pool.go
@@ -52,7 +52,11 @@ func (g *RemoteGrain) Connect() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *RemoteGrain) HandleMessage(message *Message, isReplay bool) ([]byte, error) {
|
func (g *RemoteGrain) HandleMessage(message *Message, isReplay bool) ([]byte, error) {
|
||||||
err := SendCartPacket(g.connection, g.Id, RemoteHandleMessage, message.Write)
|
err := g.Connect()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = SendCartPacket(g.connection, g.Id, RemoteHandleMessage, message.Write)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -68,7 +72,11 @@ func (g *RemoteGrain) GetId() CartId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *RemoteGrain) GetCurrentState() ([]byte, error) {
|
func (g *RemoteGrain) GetCurrentState() ([]byte, error) {
|
||||||
err := SendCartPacket(g.connection, g.Id, RemoteGetState, func(w io.Writer) error {
|
err := g.Connect()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = SendCartPacket(g.connection, g.Id, RemoteGetState, func(w io.Writer) error {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user