Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually, Static constructor should not be exposed
- Loading branch information
Showing
6 changed files
with
83 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 10 additions & 7 deletions
17
distributed-process-azure/src/Control/Distributed/Process/Backend/Azure/CommandLine.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
import Control.Monad.IO.Class (liftIO) | ||
import Control.Distributed.Process (Process) | ||
import Control.Distributed.Process.Closure (remotable, mkClosure) | ||
import Control.Distributed.Process.Backend.Azure.GenericMain (genericMain) | ||
import Control.Distributed.Process (Process, ProcessId, getSelfPid) | ||
import Control.Distributed.Process.Closure (remotable, mkClosure, sdictProcessId) | ||
import Control.Distributed.Process.Backend.Azure.GenericMain | ||
( genericMain | ||
, ProcessPair(..) | ||
) | ||
|
||
cprint :: String -> Process () | ||
cprint = liftIO . putStrLn | ||
getPid :: () -> Process ProcessId | ||
getPid () = getSelfPid | ||
|
||
remotable ['cprint] | ||
remotable ['getPid] | ||
|
||
main = genericMain __remoteTable $ \cmd -> | ||
case cmd of | ||
"hello" -> return $ $(mkClosure 'cprint) "Hi world!" | ||
"hello" -> return $ ProcessPair ($(mkClosure 'getPid) ()) print sdictProcessId | ||
_ -> error "unknown command" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters