Finite State Machine storage hub
pip install fsmhub
uvicorn fsmhub:app
FSMHUB_DB_URL=postgres://postgres:xxx@postgres.your-host uvicorn fsmhub:app
docker
docker run -p 1024:80 lwzm/fsmhub
3 HTTP APIs:
POST /new/<STATE>
, optional json payload for init custom dataPOST /lock/<STATE>
POST /transit/<ID>/<NEW-STATE>
, optional json payload for patch custom dataGET /list/locked
GET /list/<STATE>
GET /<ID>
$ http post :1024/new/a
HTTP/1.1 201 Created
Connection: Keep-Alive
content-length: 0
content-type: application/json; charset=UTF-8
$ http post :1024/lock/a
HTTP/1.1 200 OK
Connection: Keep-Alive
content-length: 71
content-type: application/json; charset=UTF-8
{
"data": {},
"id": 1,
"state": "a",
"ts": "2019-09-23 10:38:44.234700"
}
$ http post :1024/transit/1/b
HTTP/1.1 204 No Content
Connection: Keep-Alive
content-length: 0
content-type: application/json; charset=UTF-8
- postgres/sqlite trigger for log changes
- long polling
- docs