A New Project

Posted on May 11, 2014 by oubiwann


Blog post image

I've been hacking on LFE/Clojure code lately, based on the work that Maxim Molchanov has done in his Erlang/Clojure repo. This could end up being a great deal of fun :-)

Here's a quick sample of his Erlang supervisor for a Clojure node:

-module(clojurenode_sup).

-behaviour(supervisor).

%% API
-export([start_link/0]).

%% Supervisor callbacks
-export([init/1]).

%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).

%% ===================================================================
%% API functions
%% ===================================================================

start_link() ->
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% ===================================================================
%% Supervisor callbacks
%% ===================================================================

init([]) ->
    {ok, { {one_for_one, 5, 10}, [?CHILD(clj_controller, worker)]} }.

Note sure if the work I'm doing with LFE and Clojure will go anywhere yet, but even if it doesn't, it's a ton of fun :-)

Author oubiwann
Date May 11, 2014
Time 22:55:55
Category Prototypes
Tags clojure code development erlang
Line Count 19
Word Count 127
Character Count 1407

Comments?
This blog doesn't use standard (embedded) comments; however, since the site is hosted on Github, if there is something you'd like to share, please do so by opening a "comment" ticket!