Releases: kataras/neffos
v0.0.11
v0.0.10
Contains two fixes
- Fix
Server.Broadcast
call insideServer.OnConnect
callback whenServer.UseStackExchange
is used. - Add
Server.SyncBroadcaster
which, if set to true, changes the default behavior and syncServer.Broadcast
calls whenServer.StackExchange
is nil (orServer.UseStackExchange
is not used). When StackExchange is used then this field is ignored, published messages were correctly handled by Redis or Nats already.
v0.0.9
Fix #1 (comment)
Relative: kataras/iris#1316
v0.0.8
v0.0.7
- Add support for scaling-out using Nats with the
stackexchange/nats
subpackage, among with Redis from previous version. - Add support to register many StackExchanges.
- Implement a
Server.Ask
which will block until/wait for a response from a specific client ifmsg.To
is filled or from the first responder from either the cloud(if StackExchange is used) or from this server instance's connected clients, ofc you should still use theConn.Ask
if you know the client to ask from. - Update gobwas/ws dependency.
Commits log:
v0.0.6
Add support for scaling-out with 3 lines of code. A new interface type of StackExchange
is created and it's used on server and server connections if registered through Server.StackExchange
field. A built-in redis StackExchange using a lightweight library is available for use.
Example:
import "github.com/kataras/neffos/stackexchange/redis"
// [server := neffos.New...]
exc, err := redis.NewStackExchange(redis.Config{}, "MyChatApp")
if err != nil {
// [...]
}
server.StackExchange = exc
Critical Commits:
Request by:
v0.0.5
Export the ability of custom ConnHandlers and a lot of improvements that allow external packages to interact with the (NewStruct) feature, an example of this is the Iris' new v11.2+ fully featured MVC websocket controller.
Minimum Go Installed required version is set to 1.12.
Critical commits:
v0.0.4
Improvements of the neffos.NewStruct connection handler.
- With the new
EnableDebug(nil_or_custom_printer)
theneffos.NewStruct
will log which field is marked as static, which method is handling a specific event and etc. - A new method
Events() neffos.Events
is added to the return value of theneffos.NewStruct
in order to handle that struct as rawneffos.Events
- this adds support to wrap one or more "controllers" on aneffos.Namespaces
orneffos.WithTimeout
connection handler. Note that whenEvents()
is used then itsSetNamespace
andSetTimeouts
have no effect because they should be handled by the parent level instead.
Example Code:
var events = neffos.Namespaces{
"ns1": neffos.NewStruct(new(myWebsocketController)).Events(),
"ns2": neffos.Events{...},
}
Have fun!
v0.0.3
Add a neffos.NewStruct
to convert struct's methods to events. Read more at: https://github.com/kataras/neffos/wiki/Getting-started#using-a-struct-value
And add a customID string
input argument to the neffos.Upgrade
which iris is using to make it compatible. The neffos users can use the whole Server as a http.Handler through its ServeHTTP
method ofc.