Distributed Tweet Aggregator
- GateKeeper
- Aggregator
- Search.Client
$ touch .env
# .env
export TWEET_CONSUMER_KEY=...
export TWEET_CONSUMER_SECRET=...
export TWEET_ACCESS_TOKEN=...
export TWEET_ACCESS_TOKEN_SECRET=...
$ source .env
$ iex --name gatekeeper@127.0.0.1 --cookie foo -S mix
iex(gatekeeper@127.0.0.1)1> TweetAggregator.GateKeeper.become_leader
:yes
$ iex --name aggregator@127.0.0.1 --cookie foo -S mix
iex(aggregator@127.0.0.1)1> TweetAggregator.Aggregator.become_leader
:yes
$ iex --name client1@127.0.0.1 --cookie foo -S mix
iex(client1@127.0.0.1)1> Node.connect :"aggregator@127.0.0.1"
true
NodeMonitor: aggregator@127.0.0.1 joined
iex(client1@127.0.0.1)2> Node.connect :"gatekeeper@127.0.0.1"
true
NodeMonitor: gatekeeper@127.0.0.1 joined
iex(client1@127.0.0.1)3> TweetAggregator.Search.Client.poll ["elixir"]
New results
Client: Got 1 result(s)
>> client1
@noctarius2k: Elixir - The Ruby like Erlang VM Language http://t.co/FzCeytAv5t