Gascheduler集群中任務的調(diào)度器
這個庫是Game Analytics貢獻的。該庫實現(xiàn)了一個通用的用于處理集群中任務的調(diào)度器。任務的生成和處理是專為特定的應用??蛻舳藗鬟f一個需要被執(zhí)行的回調(diào)函數(shù)作為入?yún)?,調(diào)度器會通過消息返回任務的狀態(tài)。
execute(SchedulerName, MFA = {Mod, Fun, Args})
|
|
v
.--->[ Pending ]---.
| |
node down spawn worker
| |
`---[ Running ]<---'-----------.
| | |
| exception retry
| | |
| `--->[ Failed ]---'
success | |
| max retries MFA called
| exceeded throw(gascheduler_permanent_failure)
| | |
| v |
| {error, max_retries} |
| v
| {error, permanent_failure}
v
{ok, Result = apply(Mod, Fun, Args)}評論
圖片
表情
