delayGroup :: Serializable b => Shell a (Grp b) -> DNA (Group b)
delayGroup (Shell child _ src) = do
    myACP         <- getMonitor
    (sendB,recvB) <- liftP newChan
    (sendN,recvN) <- liftP newChan
    let param :: Serializable b => SendEnd (Grp b) -> SendPort b -> Process ()
        param (SendGrp chans) chB = forM_ chans $ \ch -> sendChan ch (SendRemote [chB])
    liftP $ param src sendB
    sendACP $ ReqConnect child (SingleActor myACP) [sendN]
    return  $ Group recvB recvN




----------------------------------------------------------------
-- Running actors
--
-- We use relatively complicated algorithm for spawning actors. To
-- spawn shell (not connected anywhere) actor we send message to our
-- ACP which in turn spawns ACP for shell actor.
--
----------------------------------------------------------------

-- | Start execution of standard actor.
delayGroup :: Serializable b => Shell a (Grp b) -> DNA (Group b)
delayGroup (Shell child _ src) = do
    myACP         <- getMonitor
    (sendB,recvB) <- liftP newChan
    (sendN,recvN) <- liftP newChan
    let param :: Serializable b => SendEnd (Grp b) -> SendPort b -> Process ()
        param (SendGrp chans) chB = forM_ chans $ \ch -> sendChan ch (SendRemote [chB])
    liftP $ param src sendB
    sendACP $ ReqConnect child (SingleActor myACP) [sendN]
    return  $ Group recvB recvN




----------------------------------------------------------------
-- Running actors
--
-- We use relatively complicated algorithm for spawning actors. To
-- spawn shell (not connected anywhere) actor we send message to our
-- ACP which in turn spawns ACP for shell actor.
--
----------------------------------------------------------------

-- | Start execution of standard actor.
delayGroup (Shell child _ src) = do
    myACP         <- getMonitor
    (sendB,recvB) <- liftP newChan
    (sendN,recvN) <- liftP newChan
    let param :: Serializable b => SendEnd (Grp b) -> SendPort b -> Process ()
        param (SendGrp chans) chB = forM_ chans $ \ch -> sendChan ch (SendRemote [chB])
    liftP $ param src sendB
    sendACP $ ReqConnect child (SingleActor myACP) [sendN]
    return  $ Group recvB recvN




----------------------------------------------------------------
-- Running actors
--
-- We use relatively complicated algorithm for spawning actors. To
-- spawn shell (not connected anywhere) actor we send message to our
-- ACP which in turn spawns ACP for shell actor.
--
----------------------------------------------------------------

-- | Start execution of standard actor.