Repositories¶
Important
The synchronous version is generated from the async version
Async¶
- exception purgatory.service._async.repository.ConfigurationError¶
- class purgatory.service._async.repository.AsyncAbstractRepository¶
-
- async initialize() None ¶
Override to initialize the repository asynchronously
- abstract async update_state(name: str, state: str, opened_at: float | None) None ¶
Sate the new staate of the circuit breaker into the repository.
- abstract async inc_failures(name: str, failure_count: int) None ¶
Increment the number of failure in the repository.
- abstract async reset_failure(name: str) None ¶
Reset the number of failure in the repository.
- class purgatory.service._async.repository.AsyncInMemoryRepository¶
-
- async update_state(name: str, state: str, opened_at: float | None) None ¶
Because the get method return the object directly, nothing to do here.
- async inc_failures(name: str, failure_count: int) None ¶
Because the get method return the object directly, nothing to do here.
- async reset_failure(name: str) None ¶
Reset the number of failure in the repository.
- class purgatory.service._async.repository.AsyncRedisRepository(url: str)¶
- async initialize() None ¶
Override to initialize the repository asynchronously
- async update_state(name: str, state: str, opened_at: float | None) None ¶
Store the new state in the repository.
- async inc_failures(name: str, failure_count: int) None ¶
Store the new state in the repository.
- async reset_failure(name: str) None ¶
Reset the number of failure in the repository.
Sync¶
- exception purgatory.service._sync.repository.ConfigurationError¶
- class purgatory.service._sync.repository.SyncAbstractRepository¶
-
- initialize() None ¶
Override to initialize the repository asynchronously
- abstract update_state(name: str, state: str, opened_at: float | None) None ¶
Sate the new staate of the circuit breaker into the repository.
- abstract inc_failures(name: str, failure_count: int) None ¶
Increment the number of failure in the repository.
- abstract reset_failure(name: str) None ¶
Reset the number of failure in the repository.
- class purgatory.service._sync.repository.SyncInMemoryRepository¶
-
- update_state(name: str, state: str, opened_at: float | None) None ¶
Because the get method return the object directly, nothing to do here.
- inc_failures(name: str, failure_count: int) None ¶
Because the get method return the object directly, nothing to do here.
- reset_failure(name: str) None ¶
Reset the number of failure in the repository.
- class purgatory.service._sync.repository.SyncRedisRepository(url: str)¶
- initialize() None ¶
Override to initialize the repository asynchronously
- update_state(name: str, state: str, opened_at: float | None) None ¶
Store the new state in the repository.
- inc_failures(name: str, failure_count: int) None ¶
Store the new state in the repository.
- reset_failure(name: str) None ¶
Reset the number of failure in the repository.