Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool interface { // Pop gets a vm.VM from Pool concurrent-safely // if it's implement in no-block way, it may return nil Pop() vm.VM // Push sets a vm.WorkerVM to Pool concurrent-safely. Push(vm.VM) // Walk try to apply each vm.VM with wf until wf return false or all vm.WorkerVM in Pool have been applied. Walk(wf func(v vm.VM) (terminal bool)) // Close close all vm.WorkerVM in Pool. Close() }
Pool is the reusable vm.VM pool, Pop and Push is concurrent-safe
type PoolImpl ¶
type PoolImpl struct {
// contains filtered or unexported fields
}
PoolImpl implement Pool.
func NewPoolImpl ¶
NewPoolImpl create PoolImpl.
func (*PoolImpl) Pop ¶
Pop gets a vm.VM from Pool concurrent-safely if it's implement in no-block way, it may return nil.
Click to show internal directories.
Click to hide internal directories.