summaryrefslogtreecommitdiff
path: root/taskflow/engines/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace abc.abstractproperty with property and abc.abstractmethodljhuang2022-08-031-2/+4
| | | | | | | | | Replace abc.abstractproperty with property and abc.abstractmethod, as abc.abstractproperty has been deprecated since python3.3[1] [1]https://docs.python.org/3.8/whatsnew/3.3.html?highlight=deprecated#abc Change-Id: I1bcecd99d8856c26621a5304d9f7f01f8f111918
* Remove sixTakashi Kajinami2022-05-181-4/+1
| | | | | | | | This library no longer supports Python 2, thus usage of six can be removed. This also removes workaround about pickle library used in Python 2 only. Change-Id: I19d298cf0f402d65f0b142dea0bf35cf992332a9
* turn on warning-is-error in doc buildDoug Hellmann2017-07-081-2/+4
| | | | | Change-Id: Id87a1b17c1986d0e30629fed13bdfbecef4a3603 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* Fix some misspellings in the function name and descriptionsPablo Iranzo Gómez2016-06-301-1/+1
| | | | Change-Id: I7e3451feb94b1f25b00c5e7b197bb6b527548306
* Remove deprecated things for 2.0 releaseJoshua Harlow2016-05-101-25/+0
| | | | Change-Id: Id9adbc50bd51adc77ce88f698ad0ea2ee63fc5e2
* Add some basic/initial engine statisticsJoshua Harlow2016-02-011-0/+16
| | | | | | | | | | | | | | | It can be quite nice to expose a basic set of metrics about the internals of an engine, including the time in each state, and how long the engine is active for and likely more in the future. To start add a engine statistics property and gather some basic timing data and place this data into this property for access (and/or introspection) by users. Part of blueprint gather-engine-statistics Change-Id: Ibc3c78755bd8ae779b52fc4772519f243a521576
* Change name of misc.ensure_dict to misc.safe_copy_dictJoshua Harlow2015-12-141-1/+1
| | | | Change-Id: I2ff3b9bb4d0b8143163e4bf370f10c74e79dbd31
* Add optional 'defer_reverts' behaviorGreg Hill2015-11-171-4/+2
| | | | | | | | | | | This makes it possible to REVERT a subflow and have it also revert the parent flow if the parent flow doesn't have its own retry strategy. We will probably want to make this new behavior the default or only behavior in a future release. Change-Id: Iea5ac366380ba7396a87d0185703549fb0c2f825
* Add ability to reset an engine via a `reset` methodJoshua Harlow2015-07-181-1/+14
| | | | | | | | | | If an engines work was previously partially completed and it is desired to reset it (and re-run) so that partially completed or ignored (or other) work inside of it can run again make that possible by exposing and documenting a new `reset` method (and use it internally as well). Change-Id: I47f82010a2108d5d8fd5e42ca9f7e5f165e65488
* Update all removal_version from being ? to being 2.0Joshua Harlow2015-07-121-2/+2
| | | | | | | | Before the 2.0 release it would be great to get these removed so let's mark that version as the version that will no longer have these in it. Change-Id: I66a74d270bf95db005e9febfce1a5e211c7a49f6
* Use sphinx deprecated docstring markupJoshua Harlow2015-06-101-1/+9
| | | | | | | | | | Along with using the `debtcollector` library we should also be marking the docstrings of deprecated functions/methods/properties with the appropriate deprecated information so that the generated docs also show what is deprecated. Change-Id: I8a1960731fd53434bf04d22cc6ff208998adb4f3
* Allow the storage unit to use the right scoping strategyJoshua Harlow2015-03-111-5/+2
| | | | | | | | | | | | | | | Instead of having the fetch arguments functions need to be provided a scope walker to correctly find the right arguments, which only the internals of the action engine know about provide a default scope walker (that is the same one the action engine internal uses) to the storage unit and have it be the default strategy used so that users need not know how to pass it in (which they should not care about). This allows for users to fetch the same mapped arguments as the internals of the engine will fetch. Change-Id: I1beca532b2b7c7ad98b09265a0c4477658052d16
* Allow injected atom args to be persistedJoshua Harlow2015-03-111-5/+14
| | | | | | | | | | | | | | | | | | | | | Instead of only storing injected atom arguments in memory allow for specifying those to be persisted; so that users who desire this feature can persist them (it defaults to being transient to retain the old API behavior). This also reworks the validating of engine dependencies to be more correct. It removes the validation of these dependencies from the prepare() method and moves them to a new engine validate() method; this allows users to prepare() the engine, then inject there atom non-transient arguments and then validate(); the validation would fail prior to this at preparation time since no injected arguments would exist and the user would not have the ability to inject any that target a specific atom, since the atom detail would not have been created yet (since that is populated in the prepartion method). Change-Id: I2846d0334db32a115592f850d85b206d9e6a3f07
* Use debtcollector library to replace internal utilityJoshua Harlow2015-02-191-7/+5
| | | | | | | | | | | The new debtcollector library was extracted from this code and has now been released (and made available in the requirements list) so we can go ahead and just use it for most of the cases (minus the proxy moved class) in our code-base to reduce the amount of custom code we have to maintain to perform deprecation activities. Change-Id: Ieeda6ffe282b67a1c1bb4f72e5858d22df0f30a0
* Default to using a thread-safe storage unitJoshua Harlow2015-02-051-5/+2
| | | | | | | | | | | Instead of having a nominally useful single-threaded storage unit that uses a dummy r/w lock and a multi-threaded storage unit just have the storage unit by default protect itself from multi-threading calls being used on it (with the appropriate reader/writer locks being activated to make this work correctly). Change-Id: Ib6879edb465156a8e54fd5b4002550d1cec49137
* Retain the existence of a 'EngineBase' until 0.7 or laterJoshua Harlow2014-12-121-0/+7
| | | | | | | | | | For the recently renamed 'EngineBase' -> 'Engine' cleanup it would be nice to retain the 'EngineBase' old named class for a deprecation cycle. To enable this use the newly made deprecation function that allows for creating inheritable classes that emit deprecation warnings when constructed. Change-Id: Ia67c924bc5896fbdc59bea25bf08fd87954905d0
* Remove the base postfix for engine abstract base classJoshua Harlow2014-12-101-1/+1
| | | | | | | | | Remove the non-standard pattern of calling the engine base class EngineBase; since it's already obvious that its a base class by it existing in the base engine module. Change-Id: Ia146ec6541ee96aa6a78fa659267d2a69e3b9e97
* Mark 'task_notifier' as renamed to 'atom_notifier'Joshua Harlow2014-11-201-2/+24
| | | | | | | | | | | | | | Deprecate the usage of an engines 'task_notifier' in favor of the more appropriately named 'atom_notifier' and mark the 'task_notifier' property as subject to removal in a future version. This makes the usage of this notifier more clear since it is not only used for task notification but also for retry notification (which is why naming it atom notifier is more suited to its actual usage). Change-Id: I79d58a08fd8e6d7c8990e70bdfaae415202aa929
* Revert wrapt usage until further noticeJoshua Harlow2014-11-201-24/+2
| | | | | | | | | | | Currently its usage is failing on stable/icehouse which is being fixed, but that branch is also currently broken due to a tempest failure; so until this situation is resolved take out the usage of wrapt. Part of fixes for bug 1394647 Change-Id: Ibfe21944b6e6882f19f7cf4359e8356a64200278
* Mark 'task_notifier' as renamed to 'atom_notifier'Joshua Harlow2014-11-191-2/+24
| | | | | | | | | | | | | | Deprecate the usage of an engines 'task_notifier' in favor of the more appropriately named 'atom_notifier' and mark the 'task_notifier' property as subject to removal in a future version. This makes the usage of this notifier more clear since it is not only used for task notification but also for retry notification (which is why naming it atom notifier is more suited to its actual usage). Change-Id: Idfa31a6665e43dcc9360f0aed40e27817d9e6737
* Remove direct usage of the deprecated notifier locationJoshua Harlow2014-10-191-2/+3
| | | | | | | | Internally we should be using the new location and not the deprecated location wherever possible. This avoids emitting warnings messages on our own code, which is a dirty habit. Change-Id: Icc389e61613bc78e64083f0086f6f23aabd243d1
* Deprecate `engine_conf` and prefer `engine` insteadJoshua Harlow2014-10-181-4/+9
| | | | | | | | | | | | | | | | | | | | | | To avoid having one set of options coming from `engine_conf` and another set of options coming from `kwargs` and another set coming from `engine_conf` if it is a URI just start to shift toward `engine_conf` being deprecated and `engine` being a string type only (or a URI with additional query parameters) and having any additional **kwargs that are provided just get merged into the final engine options. This adds a new helper function that handles all these various options and adds in a keyword argument `engine` that will be shifted to in a future version (in that future version we can also then remove the `engine_conf` and just stick to a smaller set of option mechanisms). It also adjusts all examples to use this new and more easier to understand format and adjusts tests, conductor interface to use this new more easily understandable style of getting an engine. Change-Id: Ic7617057338e0c63775cf38a24643cff6e454950
* Upgrade hacking version and fix some of the issuesJoshua Harlow2014-06-131-3/+6
| | | | | | | | | | | | | | | | | Update hacking to the new requirements version and fix about half of the new reported issues. The other hacking issues are for now ignored until fixed by adjusting our tox.ini file. This commit fixes the following new hacking errors: H405 - multi line docstring summary not separated with an empty line E265 - block comment should start with '# ' F402 - import 'endpoint' from line 21 shadowed by loop variable Change-Id: I6bae61591fb988cc17fa79e21cb5f1508d22781c
* Rework the overview of the notification mechanismJoshua Harlow2014-05-231-1/+7
| | | | | | | | | Clean up the introduction where the notification mechanism is defined so that it becomes more clear what its usage is and what the attributes of an engine are that provide these capabilities. Change-Id: I4eeb9029b17d562111371c6f5155570b7a31859c
* Add a cachedproperty descriptorJoshua Harlow2014-05-051-6/+2
| | | | | | | | | | | | | It is pretty common that we create a property method that checks if an instance variable is none, then creates it and then sets the instance property (and then never gets called to create it again, unless property is reset to none). Apply this new property descriptor to a few places that are redoing this same action over (don't repeat yourself principle in action). Change-Id: If6c20c5a2d145c51af3f3db56a4746eca8601253
* Engine _cls postfix is not correctJoshua Harlow2014-05-041-3/+4
| | | | | | | | | | Some of the time these attributes are types but other times they are functions, to avoid the confusion of naming these with a '_cls' postfix move to having a '_factory' postfix since these attributes generate other objects (which is what factories do). Change-Id: I73edd0c794223d719fbfbd0608c985cb335c8c26
* Allow jobboard event notificationJoshua Harlow2014-04-211-2/+2
| | | | | | | | | | | | | | | | | | | Instead of requiring iteration to be able to list new jobs and existing jobs so that they can be claimed, allow for attaching callbacks to the jobboard where instead of requiring iteration those callbacks will be automatically called by the jobboard internally when events are recieved. Breaking change: renames transition notifier to notifier since it is really not just a notifier for transitions but is a generic notifier of events occuring (and details about those events). This is an internal api so its not expected that this will cause any issues (it's not expected for external users to be creating instances of this class). Implements bp board-notification Change-Id: I2384d5e335ed9d17e29fec9a78699e3156fa225c
* Add a engine preparation stageJoshua Harlow2014-03-311-0/+10
| | | | | | | | | | | | | | Move the final logic of the compilation stage (and pre-run) code into a new engine stage that is devoted to performing post-compile but pre-run actions. Do the final validation that was being done in compile() and run() in this stage instead of being split across those two stages. Breaking change: any user expecting storage to be ensured after compilation will have to adjust their code to call prepare (after which they can continue to expect storage to be ready). Change-Id: Ie97bc4a795266dda9d7ae8b395bcaadcd1ada737
* Remove extraneous vim configuration commentsyangxurong2014-02-141-2/+0
| | | | | | | | | Remove line containing comment - # vim: tabstop=4 shiftwidth=4 softtabstop=4 Change-Id: I7581cc88b8de433d5609ed06c6570b0b45c13573 Closes-Bug:#1229324
* Doc strings and comments clean-upskudriashev2014-01-261-2/+2
| | | | | | | | * Added missing period for doc strings * Correct syntax errors * Remove H402 from flake8 ignore list Change-Id: Ia8592bf99378e3658d6cca2ceb148bf9eb0b5de8
* Cleanup engine base classJoshua Harlow2014-01-231-4/+33
| | | | | | | | | | | | - Add comments and abstract methods that all engines should implement. - Adjust creation of the storage property so that it is created on first access instead of on initialization. - Move notifiers to top level base class since they should be properties of all engines. Change-Id: I36cf2b5435d12fa59e015ce5370644020093461d
* All classes should explicitly inherit object classanastasia-karpinska2013-11-281-1/+2
| | | | | | | To avoid pylint errors six.with_metaclass was substituted with six.add_metaclass and explicit inheritance of object class. Change-Id: I516f111a9ba1af414b1a5daefad44b743af0412f
* Move toward python 3/2 compatible metaclassJoshua Harlow2013-10-091-2/+4
| | | | Change-Id: Ia7e07a7530e26c388c5da3e362510233b6a65aa6
* Add a set of useful listenersJoshua Harlow2013-10-071-0/+1
| | | | | | | | | | | | In order to understand how listeners are used it is pretty nice to have a default set that do basic printing and logging that can be used in debugging (or just as examples). Include an example that uses this as well. Fixes: bug 1224060 Change-Id: I7ba6e9dcbdca84d014b9d1f5054ce7a37eb766f2
* Simpler API to load flows into enginesIvan A. Melnikov2013-10-031-0/+40
Previously to run a flow client code had to put together the flow, an engine, logbook, flowdetail, and storage backend. This commit adds two helper functions, run() and load(), so that simplest usecase now looks like taskflow.engines.run(flow) Client code may also provide configuration for storage and engine if needed, but if not needed it just works with defaults. Engines are loaded via stevedore, as drivers in 'taskflow.engines' backend. Now three entry points are defined in that namespace: - 'default', for SingleThreadedActionEngine, used by default; - 'serial', as another synonym for SingleThreadedActionEngine; - 'parallel', for MultiThreadedActionEngine. Closes-bug: #1224726 Change-Id: I7f4cb5c8ff7f5f12831ddd0952c202d2fd8cd6ef