aboutsummaryrefslogtreecommitdiff
path: root/jsonrpc/client
diff options
context:
space:
mode:
authorhozan23 <hozan23@karyontech.net>2024-06-13 14:49:09 +0200
committerhozan23 <hozan23@karyontech.net>2024-06-13 14:49:09 +0200
commitc71e731b4c31a942ec699e2930a3ebd803c98f3b (patch)
tree4634af20ed620348922577c546dd7d9405a9a26f /jsonrpc/client
parent8c2d37e093ca64d591fc0aec15a7e2ed424b2e47 (diff)
add an example
Diffstat (limited to 'jsonrpc/client')
-rw-r--r--jsonrpc/client/client.go4
-rw-r--r--jsonrpc/client/message_dispatcher.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/jsonrpc/client/client.go b/jsonrpc/client/client.go
index a34828a..67ed307 100644
--- a/jsonrpc/client/client.go
+++ b/jsonrpc/client/client.go
@@ -32,8 +32,8 @@ type RPCClientConfig struct {
type RPCClient struct {
config RPCClientConfig
conn *websocket.Conn
- requests messageDispatcher[message.RequestID, message.Response]
- subscriber messageDispatcher[message.SubscriptionID, json.RawMessage]
+ requests *messageDispatcher[message.RequestID, message.Response]
+ subscriber *messageDispatcher[message.SubscriptionID, json.RawMessage]
stop_signal chan struct{}
}
diff --git a/jsonrpc/client/message_dispatcher.go b/jsonrpc/client/message_dispatcher.go
index 6484484..dab75ca 100644
--- a/jsonrpc/client/message_dispatcher.go
+++ b/jsonrpc/client/message_dispatcher.go
@@ -14,9 +14,9 @@ type messageDispatcher[K comparable, V any] struct {
}
// newMessageDispatcher Creates a new messageDispatcher
-func newMessageDispatcher[K comparable, V any](bufferSize int) messageDispatcher[K, V] {
+func newMessageDispatcher[K comparable, V any](bufferSize int) *messageDispatcher[K, V] {
chans := make(map[K]chan<- V)
- return messageDispatcher[K, V]{
+ return &messageDispatcher[K, V]{
chans: chans,
bufferSize: bufferSize,
}