1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 18:07:01 +00:00

sync kataras/iris/websocket with kataras/neffos - added support for nats scaling and Server.Ask method

Former-commit-id: 3a3f00410e113817c4e609feaad70f76c0b09b57
This commit is contained in:
Gerasimos (Makis) Maropoulos
2019-07-14 20:22:59 +03:00
parent c2c748067c
commit 86a18ff545
2 changed files with 11 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/kataras/neffos"
"github.com/kataras/neffos/gobwas"
"github.com/kataras/neffos/gorilla"
"github.com/kataras/neffos/stackexchange/nats"
"github.com/kataras/neffos/stackexchange/redis"
)
@@ -37,9 +38,18 @@ var (
DefaultIDGenerator = func(ctx context.Context) string {
return neffos.DefaultIDGenerator(ctx.ResponseWriter(), ctx.Request())
}
// NewRedisStackExchange returns a new redis StackExchange.
// The "channel" input argument is the channel prefix for publish and subscribe.
NewRedisStackExchange = redis.NewStackExchange
// NewNatsStackExchange returns a new nats StackExchange.
// The "url" input argument is the connection string of your nats server.
// The second variadic input argument can be used to use custom `nats.Option`s
// such as authentication and more nats servers addresses.
NewNatsStackExchange = nats.NewStackExchange
// WithNatsOptions can be used as the second input argument of `NewNatsStackExchange`
// to declare a struct-based configuration for the nats server(s).
WithNatsOptions = nats.With
// GorillaDialer is a `Dialer` type for the gorilla/websocket subprotocol implementation.
// Should be used on `Dial` to create a new client/client-side connection.