FaaS-based STM
This is a small library that attempts to do STM to update stored state in an object-storage system.
It also interacts with the Slack API.
The whole thing works by saving external effects until the STM commit passes; at that point, the external effects are committed also.
Usage
This can be installed in a Fn-style serverless function like this:
import logging
from slacker import Text, BaseDispatch, handle, debounce
LOG = logging.getLogger(__name__)
def handler(ctx, data=None):
LOG.debug("got request: %s", data)
try:
response = handle(ctx, data, bot_class=MyBot)
LOG.debug("returning %s %s", response.status_code, response.response_data)
return response
except Exception as e:
LOG.exception("something went wrong: %s", e)
class MyBot(BaseDispatch):
@debounce(30, text=lambda t: t.ts)
def on_message(self, srv=None, sender=None, channel=None, receivers=None, text=None):
if text.match("hello") is not None:
srv.broadcast(channel=channel,
text=Text("hello, world!"))
Metadata
Release files for faastm 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| faastm-0.1.1.tar.gz | 8.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| faastm-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.8 kB
Release files / faastm-0.1.1.tar.gz
| Download URL | faastm-0.1.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4d8245d8fb82561aa44bd3ccf20be55bf27eeb16b5ce351b9a8571ac79cec97a
|
|
BLAKE2b-256 checksum How to use checksums |
78a477407a691b3dc05a0c8e6bc30105744c771028636785a659725580f9da89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Release files / faastm-0.1.1-py3-none-any.whl
| Download URL | faastm-0.1.1-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
833ff9332165639aedd6f3ada37b9566b671b29d446b4b751b1d185f0ca323fd
|
|
BLAKE2b-256 checksum How to use checksums |
f8eb759c3ac944ef65c1bcff4a9e540ba8e041a269c218dd3b3221ea55e889d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|
Security for faastm 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.