This file contains hidden or 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
""" | |
Simple KV store accessible via TCP. | |
Supports two operations: | |
- get(key): fetching value (or None if not found) | |
- set(key, value): setting value | |
Server is single-threaded asyncio-based, which simplifies implementation, | |
and probably multi-threaded would be slower, since it would need to share `_cache` dictionary between threads. |
This file contains hidden or 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
import os | |
from time import sleep | |
import requests | |
from typing import Any | |
class CircleCI: | |
def __init__(self, token: str, project_username: str, project_reponame: str): | |
self._token = token | |
self._project = f'{project_username}/{project_reponame}' |