startActor :: (Serializable a, Serializable b)
           => Resources -> Closure (Actor a b) -> DNA (Shell (Val a) (Val b))
startActor res child = do
    ACP acp         <- getMonitor
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runActor) `closureApply` child
    liftP $ send acp $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start single collector actor
startActor :: (Serializable a, Serializable b)
           => Resources -> Closure (Actor a b) -> DNA (Shell (Val a) (Val b))
startActor res child = do
    ACP acp         <- getMonitor
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runActor) `closureApply` child
    liftP $ send acp $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start single collector actor
startActor res child = do
    ACP acp         <- getMonitor
    (shellS,shellR) <- liftP newChan
    let clos = $(mkStaticClosure 'runActor) `closureApply` child
    liftP $ send acp $ ReqSpawnShell clos shellS res
    msg <- unwrapMessage =<< liftP (receiveChan shellR)
    case msg of
      Nothing -> error "Bad shell message"
      Just  s -> return s


-- | Start single collector actor