All Projects → grafov → Bcast

grafov / Bcast

Licence: bsd-3-clause
Broadcasting library for Go. Broadcast message of any type on a set of channels. WIP

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Bcast

Vlog
An in-display logging library for Android 📲
Stars: ✭ 86 (-4.44%)
Mutual labels:  library
Neatinput
A .NET standard project which aims to make keyboard and mouse input monitoring easy on Windows and eventually Linux.
Stars: ✭ 89 (-1.11%)
Mutual labels:  library
Spider
A small dart library to generate Assets dart code from assets folder.
Stars: ✭ 90 (+0%)
Mutual labels:  library
Floatingtoast
Android library to create customizable floating animated toasts like in Clash Royale app
Stars: ✭ 86 (-4.44%)
Mutual labels:  library
Libtelegram
Fast, efficient, header-only C++ Telegram bot API library using polling or FastCGI
Stars: ✭ 88 (-2.22%)
Mutual labels:  library
Ccxt.net
CCXT.NET – CryptoCurrency eXchange Trading Library for .NET
Stars: ✭ 89 (-1.11%)
Mutual labels:  library
Igropyr
a async http server base on libuv for Chez Scheme
Stars: ✭ 85 (-5.56%)
Mutual labels:  library
Tor Android
Tor binary and library for Android
Stars: ✭ 90 (+0%)
Mutual labels:  library
Discord.js Menu
💬 Easily create Discord.js v12 embed menus with reactions and unlimited customizable pages.
Stars: ✭ 89 (-1.11%)
Mutual labels:  library
Xdg
Go implementation of the XDG Base Directory Specification and XDG user directories
Stars: ✭ 88 (-2.22%)
Mutual labels:  library
Beet.js
Polyrhythmic Sequencer library for Web Audio API.
Stars: ✭ 87 (-3.33%)
Mutual labels:  library
Androidoauth
A simple way to authenticate with Google and Facebook using OAuth 2.0 in Android
Stars: ✭ 88 (-2.22%)
Mutual labels:  library
Nimpylib
Some python standard library functions ported to Nim
Stars: ✭ 88 (-2.22%)
Mutual labels:  library
Boots
Lightweight bootstrap library for your Kotlin, Java and Android apps
Stars: ✭ 86 (-4.44%)
Mutual labels:  library
Protobuf Nim
Protobuf implementation in pure Nim that leverages the power of the macro system to not depend on any external tools
Stars: ✭ 90 (+0%)
Mutual labels:  library
Fann
Official github repository for Fast Artificial Neural Network Library (FANN)
Stars: ✭ 1,259 (+1298.89%)
Mutual labels:  library
Test Each
🤖 Repeat tests. Repeat tests. Repeat tests.
Stars: ✭ 89 (-1.11%)
Mutual labels:  library
Python Isc Dhcp Leases
Small python module for reading /var/lib/dhcp/dhcpd.leases from isc-dhcp-server
Stars: ✭ 90 (+0%)
Mutual labels:  library
Cog
A Persistent Embedded Graph Database for Python
Stars: ✭ 90 (+0%)
Mutual labels:  library
Functionalplus
Functional Programming Library for C++. Write concise and readable C++ code.
Stars: ✭ 1,286 (+1328.89%)
Mutual labels:  library

bcast package for Go

Broadcasting on a set of channels in Go. Go channels offer different usage patterns but not ready to use broadcast pattern. This library solves the problem in direct way. Each routine keeps member structure with own input channel and single for all members output channel. Central dispatcher accepts broadcasts and resend them to all members.

Usage Go Walker

Firstly import package and create broadcast group. You may create any number of groups for different broadcasts:

		import (
			"github.com/grafov/bcast"
		)

		group := bcast.NewGroup() // create broadcast group
		go group.Broadcast(0) // accepts messages and broadcast it to all members

You may listen broadcasts limited time:

		bcast.Broadcast(2 * time.Minute) // if message not arrived during 2 min. function exits

Now join to the group from different goroutines:

		member1 := group.Join() // joined member1 from one routine

Either member may send message which received by all other members of the group:

		member1.Send("test message") // send message to all members

Also you may send message to group from nonmember of a group:

		group.Send("test message")

Method Send accepts interface{} type so any values may be broadcasted.

		member2 := group.Join() // joined member2 form another routine
		val := member1.Recv() // broadcasted value received

Another way to receive broadcasted messages is listen input channel of the member.

		val := <-*member1.In // each member keeps pointer to its own input channel

It may be convenient for example when select used.

See more examples in a test suit bcast_test.go.

Install

go get github.com/grafov/bcast

The library doesn't require external packages for build. The next package required if you want to run unit tests:

gopkg.in/fatih/set.v0

License

Library licensed under BSD 3-clause license. See LICENSE.

Project status Build Status

WIP again. There is bug found (see #12) and some possible improvements are waiting for review (#9).

API is stable. No major changes planned, maybe small improvements.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].