20 lines
417 B
Go
20 lines
417 B
Go
|
package channel
|
||
|
|
||
|
// UnlimitedRunner is a Runner which runs each method
|
||
|
// in its own routine
|
||
|
type UnlimitedRunner struct {
|
||
|
}
|
||
|
|
||
|
var _ Runner = &UnlimitedRunner{}
|
||
|
|
||
|
// NewUnlimitedRunner returns a new LimitedRunner with the given amount
|
||
|
// of allowed routines
|
||
|
func NewUnlimitedRunner() *UnlimitedRunner {
|
||
|
return &UnlimitedRunner{}
|
||
|
}
|
||
|
|
||
|
// Run always returns immediately
|
||
|
func (r *UnlimitedRunner) Run(f func()) {
|
||
|
go f()
|
||
|
}
|