starpc 0.33.5 → 0.33.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/go.mod CHANGED
@@ -13,7 +13,7 @@ replace nhooyr.io/websocket => github.com/paralin/nhooyr-websocket v1.8.12-0.202
13
13
 
14
14
  require (
15
15
  github.com/aperturerobotics/protobuf-go-lite v0.6.5 // latest
16
- github.com/aperturerobotics/util v1.24.0 // latest
16
+ github.com/aperturerobotics/util v1.25.7 // latest
17
17
  )
18
18
 
19
19
  require (
@@ -42,7 +42,7 @@ require (
42
42
  github.com/multiformats/go-varint v0.0.7 // indirect
43
43
  github.com/spaolacci/murmur3 v1.1.0 // indirect
44
44
  golang.org/x/crypto v0.19.0 // indirect
45
- golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect
45
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
46
46
  golang.org/x/sys v0.18.0 // indirect
47
47
  lukechampine.com/blake3 v1.2.1 // indirect
48
48
  )
package/go.sum CHANGED
@@ -4,8 +4,8 @@ github.com/aperturerobotics/json-iterator-lite v1.0.0 h1:cihbrYWoK/S2RYXhJLpDZd+
4
4
  github.com/aperturerobotics/json-iterator-lite v1.0.0/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
5
5
  github.com/aperturerobotics/protobuf-go-lite v0.6.5 h1:AuPPcZ7ZaJe9ZYYC4gF7/5/Xbn9Mt9uXyV3+ADWy+Ys=
6
6
  github.com/aperturerobotics/protobuf-go-lite v0.6.5/go.mod h1:YTbfnUj3feSULhs8VgepAHFnF3wUc0CPj4jd2axy21I=
7
- github.com/aperturerobotics/util v1.24.0 h1:QIZ2Fr9H+pV9uYs7JHMQPL4+Lz/2BagdrQq09Kru3mQ=
8
- github.com/aperturerobotics/util v1.24.0/go.mod h1:QiSWcOha1HhCI4f48w6rd3gia9jIMGpfoeJiZMU+jLM=
7
+ github.com/aperturerobotics/util v1.25.7 h1:e9fdF3W/E7IHdl7YAJC0jjuxGph7yzE3a5zZoLFJ3G0=
8
+ github.com/aperturerobotics/util v1.25.7/go.mod h1:G5ybyxaL62Rdv0K5ZGqu+D1NfqlZCLYPQhdfiYhxlAg=
9
9
  github.com/cloudflare/circl v1.3.8 h1:j+V8jJt09PoeMFIu2uh5JUyEaIHTXVOHslFoLNAKqwI=
10
10
  github.com/cloudflare/circl v1.3.8/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU=
11
11
  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -57,8 +57,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
57
57
  github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
58
58
  golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
59
59
  golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
60
- golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w=
61
- golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
60
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
61
+ golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
62
62
  golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
63
63
  golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
64
64
  golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.33.5",
3
+ "version": "0.33.7",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -83,8 +83,8 @@
83
83
  "./{srpc,echo,e2e,integration,rpcstream,cmd}/**/(*.ts|*.tsx|*.html|*.css)": "prettier --config .prettierrc.yaml --write"
84
84
  },
85
85
  "devDependencies": {
86
- "@typescript-eslint/eslint-plugin": "^7.14.1",
87
- "@typescript-eslint/parser": "^7.14.1",
86
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
87
+ "@typescript-eslint/parser": "^8.0.0",
88
88
  "depcheck": "^1.4.6",
89
89
  "esbuild": "^0.23.0",
90
90
  "eslint": "^9.1.1",
@@ -105,7 +105,7 @@ func (r *ClientRPC) HandleCallStart(pkt *CallStart) error {
105
105
  // Close releases any resources held by the ClientRPC.
106
106
  func (r *ClientRPC) Close() {
107
107
  if r.writer != nil {
108
- _ = r.WriteCancel()
108
+ _ = r.WriteCallCancel()
109
109
  }
110
110
 
111
111
  r.bcast.HoldLock(func(broadcast func(), getWaitCh func() <-chan struct{}) {
@@ -173,8 +173,8 @@ func (c *commonRPC) HandleCallData(pkt *CallData) error {
173
173
  return err
174
174
  }
175
175
 
176
- // WriteCancel writes a call cancel packet.
177
- func (c *commonRPC) WriteCancel() error {
176
+ // WriteCallCancel writes a call cancel packet.
177
+ func (c *commonRPC) WriteCallCancel() error {
178
178
  if c.writer != nil {
179
179
  return c.writer.WritePacket(NewCallCancelPacket())
180
180
  }
@@ -13,6 +13,9 @@ type MsgStreamRw interface {
13
13
 
14
14
  // WriteCallData writes a call data packet.
15
15
  WriteCallData(data []byte, complete bool, err error) error
16
+
17
+ // WriteCallCancel writes a call cancel (close) packet.
18
+ WriteCallCancel() error
16
19
  }
17
20
 
18
21
  // MsgStream implements the stream interface passed to implementations.
@@ -75,12 +78,12 @@ func (r *MsgStream) CloseSend() error {
75
78
 
76
79
  // Close closes the stream.
77
80
  func (r *MsgStream) Close() error {
78
- _ = r.CloseSend()
81
+ err := r.rw.WriteCallCancel()
79
82
  if r.closeCb != nil {
80
83
  r.closeCb()
81
84
  }
82
85
 
83
- return nil
86
+ return err
84
87
  }
85
88
 
86
89
  // _ is a type assertion