-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
37 lines (23 loc) · 1.47 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
I always do the README last, so I apologize for the docs being crappy. This implementation however, is very straight forward.
This application is running atop Basho's rebar. Therefore, you can get a simple terminal-version running by following these directions:
1. Look in src/pusherl.app.src and replace the configurable pusher application variables with your application's credentials.
2. In your terminal (I'm assuming you have Erlang R14B02 or higher installed) do the following:
./rebar get-deps
./rebar compile
./rebar generate
and finally to start an interactive console:
./rel/pusherl/bin/pusherl console
3. You may now execute push commands to pusher with the following:
A quick caveat I'd like to point out. If you are building this as a stand-alone release (not in another otp app) to try it out, you will want to to the following:
On line 2 of rel/reltool.config you will see something like this
{lib_dirs, ["../../"]},
You will want to change it to this
{lib_dirs, ["../deps","../../"]},
Yes, include the comma at the end.
USAGE
If you wish to perform synchronous pushes:
gen_server:call({push, {"ChannelName", "EventName", "Payload"}}).
If you wish to perform asynchronous pushes (this is asynchronous at the gen_server level, not the httpc level...yet):
gen_server:cast({push, {"ChannelName", "EventName", "Payload"}}).
This application includes mochiweb for it's fantastic json de/encoding. I have not yet extensively tested that it works in all cases with json.
Thanks.