Go to file
Anton Kaliaev a99b8a6210
new events package
query parser

use parser compiler to generate query parser

I used https://github.com/pointlander/peg which has a nice API and seems
to be the most popular Golang compiler parser using PEG on Github.

More about PEG:

- https://en.wikipedia.org/wiki/Parsing_expression_grammar
- https://github.com/PhilippeSigaud/Pegged/wiki/PEG-Basics
- https://github.com/PhilippeSigaud/Pegged/wiki/Grammar-Examples

rename

implement query match function

match function

uncomment test lines

add more test cases for query#Matches

fix int case

rename events to pubsub

add comment about cache

assertReceive helper to not block on receive in tests

fix bug with multiple conditions

uncomment benchmark

first results:

```
Benchmark10Clients-2                1000           1305493 ns/op         3957519 B/op     355 allocs/op
Benchmark100Clients-2                100          12278304 ns/op        39571751 B/op    3505 allocs/op
Benchmark1000Clients-2                10         124120909 ns/op        395714004 B/op   35005 allocs/op
```

124ms to publish message to 1000 clients. A lot.

use AST from query.peg.go

separate pubsub and query packages by using Query interface in pubsub

wrote docs and refactor code

updates from Frey's review

refactor type assertion to use type switch

cleanup during shutdown

subscriber should create output channel, not the server

overflow strategies, server buffer capacity

context as the first argument for Publish

log error

introduce Option type

update NewServer comment

move helpers into pubsub_test

increase assertReceive timeout

add query.MustParse

add more false tests for parser

add more false tests for query.Matches

parse numbers as int64 / float64

try our best to convert from other types

add number to panic output

add more comments

save commit

introduce client argument as first argument to Subscribe

> Why we do not specify buffer size on the output channel in Subscribe?

The choice of buffer size of N here depends on knowing the number of
messages server will receive and the number of messages downstream
subscribers will consume. This is fragile: if we publish an additional
message, or if one of the downstream subscribers reads any fewer
messages, we will again have blocked goroutines.

save commit

remove reference counting

fix test

test client resubscribe

test UnsubscribeAll

client options

[pubsub/query] fuzzy testing

do not print msg as it creates data race!
2017-07-12 09:48:01 +03:00
autofile [autofile] close file before renaming it 2017-05-15 10:47:16 +02:00
cli [cli] add a test case to TestParseLogLevel where there is no module key 2017-05-23 23:31:29 +02:00
clist merge go-clist 2017-04-18 16:33:27 -04:00
common golint corrections 2017-06-05 16:22:01 -04:00
db go-common -> tmlibs 2017-04-18 17:56:05 -04:00
events Logger interface and tmLogger impl based on go-kit 2017-05-05 21:43:07 +04:00
flowrate don't do DeepEqual, compare ranges for durations and rates (Refs #16) 2017-05-25 13:06:42 +02:00
log [log] tracing logger 2017-05-23 23:06:20 +02:00
logger Logger interface and tmLogger impl based on go-kit 2017-05-05 21:43:07 +04:00
merkle merkle: go-common -> tmlibs 2017-04-21 16:04:58 -04:00
process go-common -> tmlibs 2017-04-18 17:56:05 -04:00
pubsub new events package 2017-07-12 09:48:01 +03:00
test go-common -> tmlibs 2017-04-18 17:56:05 -04:00
.gitignore new events package 2017-07-12 09:48:01 +03:00
CHANGELOG.md update changelog 2017-06-02 11:55:43 +03:00
Makefile return back all in Makefile 2017-05-05 21:52:01 +04:00
circle.yml Makefile and circle.yml 2017-05-01 11:30:24 -04:00
glide.lock update glide.yaml and glide.lock files 2017-05-05 21:48:02 +04:00
glide.yaml Merge pull request #7 from tendermint/log 2017-05-05 14:02:38 -04:00
merge.sh go-common -> tmlibs 2017-04-18 17:56:05 -04:00