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 PportView do | |
defstruct [ | |
:journeys, # list of Journey | |
:associations # list of Association | |
] | |
end | |
defmodule Journey do | |
defstruct[ | |
:rid, |
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 Ticker do | |
@interval 2000 | |
def start() do | |
generator_pid = spawn(__MODULE__, :generator, [Queue.new(), Queue.new()]) | |
_ticker_pid = spawn(__MODULE__, :ticker, [generator_pid]) | |
:global.register_name(:generator, generator_pid) | |
end |