status-go/api/utils.go

13 lines
217 B
Go
Raw Normal View History

package api
2018-06-27 08:11:45 +00:00
// RunAsync runs the specified function asynchronously.
2018-06-19 07:49:24 +00:00
func RunAsync(f func() error) <-chan error {
resp := make(chan error, 1)
go func() {
err := f()
resp <- err
close(resp)
}()
return resp
}