Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsannm committed May 9, 2024
1 parent fe0c23f commit acb9ecf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 59 deletions.
29 changes: 0 additions & 29 deletions std/gateways/fasthttp/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,35 +313,6 @@ func (b *bundle) wsDispatch(ctx *kit.Context, in []byte) (kit.ExecuteArg, error)
}, nil
}

func (b *bundle) writeFunc(conn kit.Conn, e *kit.Envelope) error {
switch c := conn.(type) {
case *wsConn:
outC := b.rpcOutFactory()
outC.InjectMessage(e.GetMsg())
outC.SetID(e.GetID())
e.WalkHdr(
func(key string, val string) bool {
outC.SetHdr(key, val)

return true
},
)

data, err := outC.Marshal()
if err != nil {
return err
}

_, err = c.Write(data)
outC.Release()

return err

default:
panic("BUG!! incorrect connection")
}
}

func (b *bundle) httpDispatch(ctx *kit.Context, in []byte) (kit.ExecuteArg, error) {
//nolint:forcetypeassert
conn := ctx.Conn().(*httpConn)
Expand Down
22 changes: 0 additions & 22 deletions std/gateways/fastws/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"time"

"github.com/clubpay/ronykit/kit"
"github.com/clubpay/ronykit/kit/errors"
"github.com/clubpay/ronykit/kit/utils"
"github.com/clubpay/ronykit/kit/utils/buf"
"github.com/gobwas/ws"
Expand All @@ -35,27 +34,6 @@ func newGateway(b *bundle) *gateway {
return gw
}

func (gw *gateway) writeFunc(conn kit.Conn, e *kit.Envelope) error {
outC := gw.b.rpcOutFactory()
outC.InjectMessage(e.GetMsg())
outC.SetID(e.GetID())
e.WalkHdr(func(key string, val string) bool {
outC.SetHdr(key, val)

return true
})

data, err := outC.Marshal()
if err != nil {
return errors.Wrap(kit.ErrEncodeOutgoingMessageFailed, err)
}

_, err = conn.Write(data)
outC.Release()

return err
}

func (gw *gateway) reactFunc(wsc kit.Conn, payload *buf.Bytes, n int) {
gw.b.d.OnMessage(wsc, (*payload.Bytes())[:n])
payload.Release()
Expand Down
16 changes: 8 additions & 8 deletions testenv/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/clubpay/ronykit/kit v0.12.4 h1:lvNuJLGpitUbnPYeu6hTWgem97M+pJFgv0G44RMsbeg=
github.com/clubpay/ronykit/kit v0.12.4/go.mod h1:wx77tsrsMTbXKfc4YMsMNdVQFqCdgWP2jcJYll004Wk=
github.com/clubpay/ronykit/std/clusters/p2pcluster v0.12.4 h1:Q5Yec2lu6KoBxjjqiqSK1Ee+i7BVDSweXyLtlPyZkUU=
github.com/clubpay/ronykit/std/clusters/p2pcluster v0.12.4/go.mod h1:3UGSnmzs+SfFtpJdA9YZL7F/pa8iJMfCHYc7MJcEWgg=
github.com/clubpay/ronykit/std/clusters/rediscluster v0.12.4 h1:Lq51gpeXULPjqWDqODuB3xazTPIu1Rny6v39EoJDnHQ=
github.com/clubpay/ronykit/std/clusters/rediscluster v0.12.4/go.mod h1:77FfF7Q2V9JMN0zxveUMjb1og8WxnZnF4R17CraA7N0=
github.com/clubpay/ronykit/std/gateways/fasthttp v0.12.4 h1:WFCgMTxSA+OD8IniKUYwUwj1xbCPGV0Hb36ztr8XMdA=
github.com/clubpay/ronykit/std/gateways/fasthttp v0.12.4/go.mod h1:AcaPAGzjZU+IqfQ6/ByZqj9DweJdzHGBt7U1lHg/Mxk=
github.com/clubpay/ronykit/kit v0.14.0 h1:HP69+MV6d4EYv8S9bKql4ImNGyZt8v1+TDQj3QsbAec=
github.com/clubpay/ronykit/kit v0.14.0/go.mod h1:wx77tsrsMTbXKfc4YMsMNdVQFqCdgWP2jcJYll004Wk=
github.com/clubpay/ronykit/std/clusters/p2pcluster v0.14.0 h1:3WufQmfozJaWArYoEelBZnxPBc137edgYG67vepZ71A=
github.com/clubpay/ronykit/std/clusters/p2pcluster v0.14.0/go.mod h1:xVUMrEfxOH1JZvKih6LTNxF96KKRKSQJJob5+1BpuPs=
github.com/clubpay/ronykit/std/clusters/rediscluster v0.14.0 h1:RJW1hNSU8Ol/yuiheTOzeHUxF70v7hfPSkhxy43RGQ4=
github.com/clubpay/ronykit/std/clusters/rediscluster v0.14.0/go.mod h1:7GKSQ+ifzQrm3i5UVgI1MEnMJL89zzZhvNYZNnyMvgY=
github.com/clubpay/ronykit/std/gateways/fasthttp v0.14.0 h1:anSVcLfNXdzPQQM7wFkdDzY3uZlC3BAbE+m5BSKVzjM=
github.com/clubpay/ronykit/std/gateways/fasthttp v0.14.0/go.mod h1:YF/8lnNQHDlDpuSIJpXca+RcraUJfqeklf4SnB3VcKk=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE=
github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM=
Expand Down

0 comments on commit acb9ecf

Please sign in to comment.