That API is the result of many iterations over many years. Particularly critical is how subscribers are modeled as recv-only chans of type T, which callers are responsible for constructing and providing as input.
I think it allows for much nicer statistics and little bit faster processing (the allow function is called synchronously, which prevents the goroutine communication overhad - note that the caller can mess this up, if the allow function takes a while).
I think I have a pretty good one.
Basically,
That API is the result of many iterations over many years. Particularly critical is how subscribers are modeled as recv-only chans of type T, which callers are responsible for constructing and providing as input.
Why the
allowfilter?Essentially just a first-pass filter to avoid sending unnecessary values. Definitely relies on some trust re: the caller.
I think it allows for much nicer statistics and little bit faster processing (the
allowfunction is called synchronously, which prevents the goroutine communication overhad - note that the caller can mess this up, if the allow function takes a while).