func Work(f func()) {
	work = f
}
Work registers the user defined work function. The user defined work
function gets executed in the child processes. It should receive tasks from
the Tasks channel and send the processed results to the Result channel.
package spawn
import (
	"errors"
	"os"
	"reflect"
)
var Result chan interface{}
var Task chan interface{}
var (
	self   *actor  
	parent *actor  
)
var (
	dispatch func()
	work     func()
)
var isDispatcher = os.ExpandEnv("${SPAWN_WORKER}") == ""
func init() {
	if isDispatcher {
		parent = nil
		self = newActor()
	} else {
		parent = newActorFromExtraFiles(3)
		self = newActorFromExtraFiles(7)
	}
}
var taskVal reflect.Value
var taskPtr reflect.Value
func Register(v interface{}) error {
	val := reflect.ValueOf(v)
	if val.Kind() == reflect.Ptr {
		if val.IsNil() {
			return errors.New("nil pointer")
		}
		taskPtr = val
		taskVal = val.Elem()
	} else {
		taskVal = val
	}
	return nil
}
func Dispatch(f func()) {
	dispatch = f
}