This repository has been archived by the owner on May 1, 2020. It is now read-only.
v1.0.0 - RC1
Released on 13th June 2018
This is the first release candidate version of the library. The API and the implementation are considered stable.
Summary
Since the first beta-release many new requested features as well as stability and usability improvements have been introduces.
- The WebWire binary protocol has reached version 1.4 receiving many improvements to error reporting and bug-fixes.
- Modularity has been improved by moving responsibilities to separate implementable interfaces such as
SessionManager
,ServerImplementation
,SessionKeyGenerator
,SessionInfo
,SessionInfoParser
andclient.Implementation
. - The session-key generator is now (optionally) replaceable. (#10)
- A new default file-based session manager has been introduced, which can be replaced by any custom session manager implementation at will. (#8)
- The server now shuts down gracefully waiting for active handlers to finish before terminating, gracefully rejecting incoming requests and dropping incoming signals. This means that signals are still guaranteed to arrive though not guaranteed to be processed while requests are guaranteed to either be processed or explicitly refused acknowledging the client. (#9)
- Client agents are now closed gracefully waiting for all ongoing operations to finish before termination.
- Sessions can now (optionally) have multiple simultaneous connections which is especially useful for browser-based applications running multiple application instances in separate tabs each requiring a separate client. The maximum number of simultaneous connections per session is configurable. (#4, #20)
- The client implementation has received major improvements and now (optionally) maintains the connection automatically reconnecting when the connection is lost. (#11, #12)
- Support for dep has been added. Nevertheless, webwire remains
go get
'able thanks to vendor-embedded dependencies, which are shipped with the library though stripped whendep
is used. (#2, 216d118) - Test coverage is now monitored by coveralls. (8582d04, 161be37, fd40a4e)
- Requests don't require a payload any longer. A request may now provide either only a name or only a payload or both (but not none of them). (#22, b498cca)
Changes
Server
- The payload type now implements an encoding conversion method to convert it to a UTF8 encoded string. (a05f330)
- The standard go error interface is now used for errors returned in the request hook. Returning a non-
wwr.Error
error type will now return an emptyinternal error
to the client and log it on the server to prevent leaks of sensitive information. (dfdb7b3, #PR 6) - The client implementation now provides a new
SessionInfo
method to read specific session info fields. (6541735) - Multi-Connection sessions have been introduces which allows clients to create multiple connections within a single session. This is especially useful for browsers where a single app could be opened in multiple browser-tabs each requiring one connection. (144c6ad)
- The graceful shutdown feature has been introduces which prevents active handlers from being interrupted during server shutdown. (678f860)
- New session creation error types have been added:
MaxSessConnsReachedErr
,SessNotFoundErr
,SessionsDisabledErr
. (ac73199, 060c85b, 37e0a86) - All signal and request handling related hooks have been moved to the new
ServerImplementation
interface, which must be implemented by the library user. (4020691) - The generation of the session keys have been moved to the new
SessionKeyGenerator
interface, which, by default, is implemented by the default session key generator. (f292d1e) - All session related hooks have been moved to the new
SessionManager
interface, which, by default, is implemented by the default file-based session manager. (c5e515b) - The underlying socket implementation is now abstracted away using the
Socket
interface, which is currently implemented using gorilla/websocket. (2daff67) - The client agent and message objects are now directly passed to the
OnRequest
andOnSignal
hooks instead of passing them through the context. (393d513) log.Logger
is now used for logging instead ofio.Writer
to allow for better customization of logs. (af872e5)- The server is now defined as a
webwire.Server
interface type including new methods such as:Run
,ActiveSessionsNum
,SessionConnectionsNum
andCloseSession
. A webwire server instance is now created using the new constructor function. (e1e9259) - The
SessionConnections
method will now return a list of client agents instead of just the number of concurrent connections of a session. (8f789c0) - Add a new client agent method
Close
for closing an ongoing
connection on the server side. (e1e9259) - The method
ActiveSessions
was renamed toActiveSessionsNum
. (e1e9259) - Deferred client agent shutdown has been implemented. The client agent now keeps track of all currently processed tasks and closes only when it's idle. (d3b8313)
- Support for external HTTP(S) servers has been added. The server interface now implements the standard Go HTTP handler interface and provides a new headless WebWire server constructor. (8de01cc)
- Add a new
LastLookup
field to the session object denoting the last time a session was looked up to prevent active sessions from being garbage collected.
Also update the SessionManager interface and introduce a new
return typeSessionLookupResult
to ease use declaration of the
OnSessionLookup
hook, which must now return aSessNotFoundErr
in case the session wasn't found by key. (cbd6017) - A new protocol error message type has been introduced indicating
protocol violations when parsing a message.
The webwire server will now return a protocol error message if the determined message type requires a reply, otherwise it'll just drop the message. (2316b59)
Client
client.Request
andclient.TimedRequest
will now return a specialReqTimeoutErr
error type on timeouts. (70edd63, 37e0a86)- A new
DisconnectedErr
error type indicating connection loss has been introduced. (132698f) - The client API now provides a new
IsConnected
method. (a6ee217) - The client now maintains the connection and automatically reestablishes it when it's lost, unless explicitly instructed otherwise. During connection downtime outgoing requests are buffered and resent when the connection is reestablished, all calls that fire a request will block the calling goroutine until they either time out or succeed. (aad55e7, a7b0974)
- All hooks have been moved to the new
Implementation
interface, which must be implemented by the library user. (6c4011d) - A new
SessionInfo
interface and aSessionInfoParser
function type have been introduced to make session info objects immutable and thus data race save. (2b6da64)
Bug Fixes
- A data race caused by unsynchronized access to the client session object has been fixed. (ccd0fa1)
- A protocol bug related to UTF16 encoded messages has been fixed. (83a802b)
- Concurrent access to the client agent has been synchronized preventing data races. (8ef8b85)
client.Close
will now block the calling goroutine until the socket-reader goroutine finally dies. (85933a3)- Fixed security issue in the error-reply parser. (c1adf42)
- Fixed broken session restoration (attached data won't restore) by using the session info parser
during session deserialization (from a file or a database).
Also the session info parser is now used when receiving the session on the client. (9b74216) - Prevent sessions from being destroyed when the last active connection is closed. (8b0dbd5)
Tests
Both the acceptance and the unit tests received major updates, fixes and improvements. The total test coverage reached 76% and is now monitored by coveralls.io.
Examples
All examples have been updated to use the new APIs.
Documentation
The documentation received major updates, fixes and improvements.
Special Thanks
Without the contributors this release may have never happened.
Special thanks to: