Releases: rsms/gotalk
v1.3.7
v1.3.6
v1.3.5
Adds Handlers.NewSubHandlers()
which returns a wrapper
// NewSubHandlers returns a new Handlers object which wraps the receiver.
// It can be used to override or extend h, without modifying h.
// For example, it could be used to expose an extra set of operations to certain sockets,
// like signed-in users.
func (h *Handlers) NewSubHandlers() *Handlers
v1.3.4
Adds ability to customize error logging with gotalk.ErrorLogger
and gotalk.HandlerErrorLogger
which both have the type gotalk.LoggerFunc
Example:
gotalk.HandlerErrorLogger = func(s *gotalk.Sock, format string, args ...interface{}) {
myLogger.Warn("[gotalk %p] " + format, append([]interface{}{s}, args...)...)
}
v1.3.3
v1.3.1
v1.3.0
API changes in version 1.3 compared to 1.2
-
Limits
is no longer an interface but not a plain struct with fields
you can set and edit. This simplifies the code and makes the API easier to use. -
Limits
now exposes wait times asBufferMinWait
,BufferMaxWait
,
StreamMinWait
andStreamMaxWait
. These values default to the same as in
Gotalk 1.2 (500–5000ms.) -
The string message of
ErrSockClosed
has been changed to"socket closed"
(was "socket is closed")
Other changes:
-
Fixes a race condition with closing sockets which could lead to CloseHandler
being called twice in case two user goroutines would call Sock.Close() -
Fixes a race condition that could lead to a deadlock when sending requests and
waiting for responses.
v1.2.1
Go library: Adds the ability to gracefully shut down sockets via a new method Socket.Shutdown
(low level). Note that Web Socket-based gotalk does not need this.
JS library: Increases the minimum reconnect delay after a clean connection close in keepalive. This has no effect on the API and no effect on semantics. When a server restarts and cleanly shuts down sockets, avoid slamming the server immediately with connection attempts. A future version might introduce randomness to this delay as well.
v1.2.0
Improvements to the Sock and WebSocketServer API:
-
WebSocketServer now uses a WebSocket struct type instead of Sock; a specialized derivative of Sock with methods for accessing the underlying web socket and http connection.
-
Adds new callback WebSocketServer.OnConnect, deprecating OnAccept. OnConnect receives a WebSocket struct rather than a Sock struct as is the case with OnAccept (i.e. why OnConnect was added instead of using OnAccept.)
-
Adds method Sock.String() which returns a name that uniquely identifies the socket during its lifetime. Useful for logging.
-
Deprecates the function WebSocketHandler() in favor for a better-named NewWebSocketServer(). Functionality is unchanged.