Skip to main content

a lib for describing Actions and how they should be performed

Project description

actionpack

a lib for describing Actions and how they should be performed

tests publish

Overview

Side effects are annoying. Verification of intended outcome is often difficult and can depend on the system's state at runtime. Questions like "Is the file going to be present when data is written?" or "Will that service be available?" come to mind. Keeping track of external system state is just impractical, but declaring intent and encapsulating its disposition is doable.

Usage

>>> action = ReadBytes('path/to/some/file')
...
>>> actions = [action,
...            ReadBytes('path/to/some/other/file'),
...            ReadInput('>>> how goes? <<<\n  > '),
...            MakeRequest('GET', 'http://google.com'),
...            RetryPolicy(MakeRequest('GET', 'http://bad-connectivity.com'),
...                        max_retries=2,
...                        delay_between_attempts=2)
...            WriteBytes('path/to/yet/another/file', b'sup')]
...
>>> procedure = Procedure(*actions, sync=False)
>>> procedure.execute()

Project details


Release history Release notifications | RSS feed

This version

0.5.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

actionpack-0.5.5.tar.gz (13.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page