3 ms·
> In general, if "orchestrating concurrency" involves guarding access to shared mutable state, then you can't orchestrate it at the callers site. Shared mutabl
by sagichmal 11y ago
> In general, if "orchestrating concurrency" involves guarding access to shared mutable state, then you can't orchestrate it at the callers site.
Shared mutable state is generally behind an API boundary. I'm talking about the exported method set of that API. That is,
func (f *Foo) Update(i int) (int, error) // yes
func (f *Foo) Update(i int) (<-chan int, error) // no
func (f *Foo) Update(i int, result chan<- int) error // no