{"modulePath":"github.com/GoPlugin/libocr","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package subprocesses\n\nPackage subprocesses keeps track of concurrent processes, for coordination of cleanly shutting down systems of goroutines. This is a stripped-down version of errgroup.Group, motivated by the fact that allowing a single process to shut down the entire system by returning an error is quite fragile.\n\n## Types\n\n```go\ntype Subprocesses struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *Subprocesses) BlockForAtMost(ctx context.Context, d time.Duration, f func(context.Context)) (ok bool)\n```\nBlockForAtMost invokes f and blocks for at most duration d before returning, regardless of whether f finished or not, or the passed in ctx is cancelled. If f finished, returns true. Otherwise, returns false.\n\n```go\nfunc (s *Subprocesses) BlockForAtMostMany(ctx context.Context, d time.Duration, fs ...func(context.Context)) (ok bool, oks []bool)\n```\nBlockForAtMostMany invokes all fs in parallel and blocks for at most duration d before returning, regardless of whether all fs finished or not, or the passed in ctx is cancelled. If all fs finished, returns true, \\[true, ..., true]. Otherwise, returns false, and a boolean slice indicating which fs timed out.\n\n```go\nfunc (s *Subprocesses) Go(f func())\n```\nGo calls the given function in a new goroutine.\n\n```go\nfunc (s *Subprocesses) RepeatWithCancel(name string, interval time.Duration, ctx context.Context, f func())\n```\nRepeatWithCancel repeats f with the specified interval. Cancel if ctx.Done is signaled\n\n```go\nfunc (s *Subprocesses) Wait()\n```\nWait blocks until all function calls from the Go method have returned.\n\n","path":"github.com/GoPlugin/libocr/subprocesses","name":"subprocesses","synopsis":"Package subprocesses keeps track of concurrent processes, for coordination of cleanly shutting down systems of goroutines.","isRedistributable":true}
