Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MM-56540 - Live Captions: add client.Send #130

Merged
merged 10 commits into from
Mar 22, 2024
5 changes: 5 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ func (c *Client) On(eventType EventType, h EventHandler) {
c.handlers[eventType] = h
}

// Send sends a websocket event to the server
func (c *Client) Send(ev string, msg any, binary bool) error {
return c.wsSend(ev, msg, binary)
}

func (c *Client) emit(eventType EventType, ctx any) {
c.mut.RLock()
handler := c.handlers[eventType]
Expand Down
Loading