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
-- Functions intended to make it easier to work with distributed-process | |
-- from the REPL. | |
module NodeProcess where | |
import Control.Distributed.Process | |
import Control.Distributed.Process.Serializable | |
import Control.Concurrent.MVar | |
import Control.Concurrent (threadDelay) |
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
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
module Control.Distributed.Process.Lifted | |
( module Control.Distributed.Process | |
, module Control.Distributed.Process.Lifted | |
) | |
where | |
import Control.Monad.Trans.Control |
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
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
import Control.Lens | |
declareFields [d| |
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
globalMonitor :: Process () | |
globalMonitor = do | |
let initState = [] :: [MxEvent] | |
void $ mxAgent (MxAgentId "lifecycle-listener-agent") initState [ | |
mxSink $ \ev -> do | |
let act = | |
case ev of | |
(MxProcessDied pid (DiedException msg)) -> liftMX $ say $ debug $ "[Error] " ++ show pid ++ " DiedException: " ++ msg | |
(MxProcessDied pid DiedDisconnect) -> liftMX $ say $ show pid ++ " DiedDisconnect" |
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
/* | |
* File: cocos_ref.h | |
* Author: jeremy | |
* | |
* Created on June 28, 2014, 8:38 PM | |
*/ | |
#ifndef COCOS_REF_H | |
#define COCOS_REF_H |
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
extern crate rand; | |
use std::thread; | |
use std::sync::Arc; | |
use std::sync::mpsc::{Sender, Receiver, channel}; | |
use rand::Rng; | |
fn main() { | |
let waiter = Waiter::new(); |
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
module Main where | |
import Control.Distributed.Process hiding (call) | |
import Control.Distributed.Process.Node as Node (initRemoteTable, runProcess, newLocalNode) | |
import Control.Distributed.Process.Extras (resolve, __remoteTable) | |
import Network.Transport.TCP | |
import Control.Concurrent (threadDelay) | |
import Control.Monad | |
import Network.Transport hiding (send) | |
import System.Environment |
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
defmodule BigappWeb do | |
@moduledoc """ | |
The entrypoint for defining your web interface, such | |
as controllers, views, channels and so on. | |
This can be used in your application as: | |
use BigappWeb, :controller | |
use BigappWeb, :view |
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
@webdir "bigapp_web" | |
@doc """ | |
When used, dispatch to the appropriate controller/view/etc. | |
""" | |
defmacro __using__(:view) do | |
view_path = | |
__CALLER__.file | |
|> String.split(@webdir) | |
|> List.last |
OlderNewer