-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ian Vaughan
committed
Oct 8, 2018
1 parent
bd51f7d
commit 211a80b
Showing
9 changed files
with
45 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
# Slot Sync | ||
|
||
* Syncs slot data from external provider | ||
A tool for reading data from a third party via their API and publishing to a broker. | ||
|
||
## Overview | ||
|
||
* Currently sync's slot data from WIW | ||
* Runs sync every 5 minutes (see SchedEx for :wiw_sync to change) | ||
* Caches the data locally in Redis | ||
* If remote data changed then publishes to Kafka | ||
* If newly read data has changed from cached version it then publishes to Kafka | ||
|
||
## Detail | ||
``` | ||
(every 5 minutes) | ||
|> SlotSync.Runner | ||
|> SlotSync.WIW | ||
|> 1 days worth of shifts from today | ||
|> get slots on WIW | ||
|> SlotSync.Dispatcher | ||
|> each shift | ||
|> SlotSync.Processor.Shift (GenServer) | ||
|> if matches redis cache then next (cache expires each slot after 1 week) | ||
|> if not then save in redis and publish | ||
|> SlotSync.Publishers.Kafka | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,2 @@ | ||
defmodule SlotSync do | ||
@moduledoc """ | ||
SlotSync keeps the contexts that define your domain | ||
and business logic. | ||
Contexts are also responsible for managing your data, regardless | ||
if it comes from the database, an external API or others. | ||
""" | ||
end |
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
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
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
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
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
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
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