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
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
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.3.tar.gz
(13.1 kB
view hashes)