cloderic / prime-time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prime-time

Basic setup

run services:
docker-compose up

create db:
docker-compose run api bin/bundle exec rake db:create

migrate db:
docker-compose run api bin/bundle exec rake db:create

scale workers:
docker-compose up --scale worker=3

Requests

create task:
curl -XPOST -H "Accept: application/json" -H "Content-type: application/json" -d '{"task":{"number": 20308732902 }}' localhost/tasks/

get all tasks:
curl -XGET localhost/tasks/

get a task by id:
curl -XGET localhost/tasks/:id

Explanation

Architecture

schemas

States of a task

pending: the task is waiting for a free worker
working: a worker is computing the task
done: the task is ended, the result is in the result attribute

About


Languages

Language:Ruby 86.6%Language:Rust 9.6%Language:Dockerfile 2.2%Language:HTML 0.8%Language:Shell 0.7%