startCollector :: (Serializable a, Serializable b)
               => Resources
               -> Closure (CollectActor a b)
               -> DNA (Shell (Grp a) (Val b))
startCollector res child = do
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runCollectActor) `closureApply` child
    sendACP $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start group of processes
startCollector :: (Serializable a, Serializable b)
               => Resources
               -> Closure (CollectActor a b)
               -> DNA (Shell (Grp a) (Val b))
startCollector res child = do
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runCollectActor) `closureApply` child
    sendACP $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start group of processes
startCollector res child = do
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runCollectActor) `closureApply` child
    sendACP $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start group of processes