requirements.txt
- pip install fastapi
- pip install “uvicorn[standard]”
- pip install redis
- pip install confluent_kafka
redis
- count(bid request -> bwic id)
redis> incr bwic:count:bwicId (integer) 1 redis> get bwic:count:bwicId "1" redis> incr bwic:count:bwicId (integer) 2 redis> get bwic:count:bwicId "2"
- rank(bid, cancel request -> bwic id + client id + market value)
redis> zadd bwic:rank:bwic:bwicId 1800 client:1 (integer) 1 redis> zadd bwic:rank:bwic:bwicId 1200 client:2 (integer) 1 redis> zrevrank bwic:rank:bwic:bwicId client:1 (integer) 0 redis> zrevrank bwic:rank:bwic:bwicId client:2 (integer) 1 redis> zcount bwic:rank:bwic:bwicId -inf +inf (integer) 2 redis>
- cancel:
redis> zrem bwic:rank:bwic:bwicId client:1 (integer) 1