cantok 0.0.32
pip install cantok
Released:
Implementation of the "Cancellation Token" pattern
Navigation
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License
- Author: Evgeniy Blinov
- Tags cancellation tokens, parallel programming, concurrency
- Requires: Python >=3.8
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Project description
Cancellation Token is a pattern that allows us to refuse to continue calculations that we no longer need. It is implemented out of the box in many programming languages, for example in C# and in Go. However, there was still no sane implementation in Python, until the cantok library appeared.
Quick start
Install it:
pip install cantok
And use:
from random import randint
from cantok import ConditionToken, CounterToken, TimeoutToken
token = ConditionToken(lambda: randint(1, 100_000) == 1984) + CounterToken(400_000, direct=False) + TimeoutToken(1)
counter = 0
while token:
counter += 1
print(counter)
Read more in the documentation!
Project details
Verified details
These details have been verified by PyPIProject links
GitHub Statistics
Maintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License
- Author: Evgeniy Blinov
- Tags cancellation tokens, parallel programming, concurrency
- Requires: Python >=3.8
Classifiers
- Intended Audience
- License
- Operating System
- Programming Language
- Topic
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cantok-0.0.32.tar.gz
.
File metadata
- Download URL: cantok-0.0.32.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b39be7244b2310d9811942ccb4824a27f96e038f71fde1c3f94c9283f21e54d |
|
MD5 | 3599e2318479e89abdf6aac0043171e2 |
|
BLAKE2b-256 | f2518f650102f8d89aa44f1196f6d0a8055ee9da2ee4e61560d5e773fa8c3b50 |
Provenance
The following attestation bundles were made for cantok-0.0.32.tar.gz
:
Publisher:
release.yml
on pomponchik/cantok
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cantok-0.0.32.tar.gz
- Subject digest:
2b39be7244b2310d9811942ccb4824a27f96e038f71fde1c3f94c9283f21e54d
- Sigstore transparency entry: 175831198
- Sigstore integration time:
- Permalink:
pomponchik/cantok@5d65f84887bf576d4b6ae3fed9647c8284b7f313
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/pomponchik
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@5d65f84887bf576d4b6ae3fed9647c8284b7f313
- Trigger Event:
push
- Statement type:
File details
Details for the file cantok-0.0.32-py3-none-any.whl
.
File metadata
- Download URL: cantok-0.0.32-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfca642eae45887d24b3ec170cd7432831895bf2338e454e8bcdaf45aa9829b6 |
|
MD5 | 9b627c2d7dc058d105546ba7d1e62a8d |
|
BLAKE2b-256 | 5488845a66c175de4b6039f64cc97483c956e3da66f7734820e766be020d101a |
Provenance
The following attestation bundles were made for cantok-0.0.32-py3-none-any.whl
:
Publisher:
release.yml
on pomponchik/cantok
-
Statement:
- Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
cantok-0.0.32-py3-none-any.whl
- Subject digest:
dfca642eae45887d24b3ec170cd7432831895bf2338e454e8bcdaf45aa9829b6
- Sigstore transparency entry: 175831199
- Sigstore integration time:
- Permalink:
pomponchik/cantok@5d65f84887bf576d4b6ae3fed9647c8284b7f313
- Branch / Tag:
refs/heads/main
- Owner: https://github.com/pomponchik
- Access:
public
- Token Issuer:
https://token.actions.githubusercontent.com
- Runner Environment:
github-hosted
- Publication workflow:
release.yml@5d65f84887bf576d4b6ae3fed9647c8284b7f313
- Trigger Event:
push
- Statement type: