~ubuntu-branches/ubuntu/saucy/rabbitmq-server/saucy

« back to all changes in this revision

Viewing changes to plugins-src/rabbitmq-web-stomp-examples/src/rabbit_web_stomp_examples_app.erl

  • Committer: Package Import Robot
  • Author(s): Emile Joubert
  • Date: 2012-01-31 15:28:12 UTC
  • mfrom: (0.2.20) (0.1.34 sid)
  • Revision ID: package-import@ubuntu.com-20120131152812-la0rbm603vp9s054
Tags: 3.0.2-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
%% The Original Code is RabbitMQ.
12
12
%%
13
13
%% The Initial Developer of the Original Code is VMware, Inc.
14
 
%% Copyright (c) 2012 VMware, Inc.  All rights reserved.
 
14
%% Copyright (c) 2012-2013 VMware, Inc.  All rights reserved.
15
15
%%
16
16
 
17
17
-module(rabbit_web_stomp_examples_app).
19
19
-behaviour(application).
20
20
-export([start/2,stop/1]).
21
21
 
 
22
%% Dummy supervisor - see Ulf Wiger's comment at
 
23
%% http://erlang.2086793.n4.nabble.com/initializing-library-applications-without-processes-td2094473.html
 
24
-behaviour(supervisor).
 
25
-export([init/1]).
 
26
 
22
27
start(_Type, _StartArgs) ->
23
28
    {ok, Listener} = application:get_env(rabbitmq_web_stomp_examples, listener),
24
29
    {ok, _} = rabbit_mochiweb:register_static_context(
25
30
                web_stomp_examples, Listener, "web-stomp-examples", ?MODULE,
26
31
                "priv", "WEB-STOMP: examples"),
27
 
    {ok, spawn(fun loop/0)}.
 
32
    supervisor:start_link({local, ?MODULE}, ?MODULE, []).
28
33
 
29
34
stop(_State) ->
30
35
    rabbit_mochiweb:unregister_context(web_stomp_examples),
31
36
    ok.
32
37
 
33
 
loop() ->
34
 
    receive
35
 
        _ -> loop()
36
 
    end.
 
38
init([]) -> {ok, {{one_for_one, 3, 10}, []}}.