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

Fix rapid sending/receiving of messages #16

Merged
merged 1 commit into from
Nov 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nodes/db/dbnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import (
"upper.io/db.v3/lib/sqlbuilder"
)

var OutBufferSize = 128

// Node : defines an instance of the API with a ql-DB backed Node
type Node struct {
contentKey bc.KeyPair
Expand Down Expand Up @@ -52,7 +54,7 @@ func New(contentKey, routingKey bc.KeyPair) *Node {

// setup chans
node.in = make(chan api.Msg)
node.out = make(chan api.Msg)
node.out = make(chan api.Msg, OutBufferSize)
node.events = make(chan api.Event)

// setup default router
Expand Down
4 changes: 3 additions & 1 deletion nodes/fs/fsnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import (
"github.com/awgh/ratnet/router"
)

var OutBufferSize = 128

type outboxMsg struct {
channel string
msg []byte
Expand Down Expand Up @@ -68,7 +70,7 @@ func New(contentKey, routingKey bc.KeyPair, basePath string) *Node {

// setup chans
node.in = make(chan api.Msg)
node.out = make(chan api.Msg)
node.out = make(chan api.Msg, OutBufferSize)
node.events = make(chan api.Event)

// setup default router
Expand Down
4 changes: 3 additions & 1 deletion nodes/qldb/qlnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
_ "modernc.org/ql/driver" // load the QL database driver
)

var OutBufferSize = 128

// Node : defines an instance of the API with a ql-DB backed Node
type Node struct {
contentKey bc.KeyPair
Expand Down Expand Up @@ -52,7 +54,7 @@ func New(contentKey, routingKey bc.KeyPair) *Node {

// setup chans
node.in = make(chan api.Msg)
node.out = make(chan api.Msg)
node.out = make(chan api.Msg, OutBufferSize)
node.events = make(chan api.Event)

// setup default router
Expand Down
4 changes: 3 additions & 1 deletion nodes/ram/ramnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/awgh/ratnet/router"
)

var OutBufferSize = 128

// Node : defines an instance of the API with a ql-DB backed Node
type Node struct {
contentKey bc.KeyPair
Expand Down Expand Up @@ -69,7 +71,7 @@ func New(contentKey, routingKey bc.KeyPair) *Node {

// setup chans
node.in = make(chan api.Msg)
node.out = make(chan api.Msg)
node.out = make(chan api.Msg, OutBufferSize)
node.events = make(chan api.Event)

// setup default router
Expand Down