Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikahanninen/producer-consumer-retrying
https://github.com/mikahanninen/producer-consumer-retrying
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mikahanninen/producer-consumer-retrying
- Owner: mikahanninen
- License: apache-2.0
- Created: 2022-08-04T16:20:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-09T15:54:04.000Z (over 2 years ago)
- Last Synced: 2024-11-11T04:36:56.681Z (3 months ago)
- Language: Python
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Python producer-consumer model robots using work items
This contains a working Python robot implementation that has the basic structure where one part produces work items from input and another part that consumes those work items.
The consumer part demonstrates business model where business logic is divided into 3 actions.
The consumer work item has been meant to be rerun until work item ultimately would pass. Only failing actions should
be rerun. For example if consumer failing in actions 1 and 3, then on rerun the action 2 would not be run again.> The [producer-consumer](https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem) model is not limited to two steps, it can continue so that the consumer generates further work items for the next step and so on.
The template tries to keep the amount of functional code at a minimum so you have less to clear out and replace with your own implementation, but some functional logic is needed to have the template working and guiding the key parts.
> We recommended checking out the article "[Using work items](https://robocorp.com/docs/development-guide/control-room/work-items)" before diving in.
> Also a fully functional example robot can be found at: [Web Store Order Processor Using Work Items](https://robocorp.com/portal/robot/robocorp/example-web-store-work-items)
## Tasks
The robot is split into two tasks, meant to run as separate steps in Control Room. The first task generates (produces) data, and the second one reads (consumes) and processes that data.
### The first task (the producer)
- Load the example Excel file from work item
- Splits the Excel file into work items for the consumer### The second task (the consumer)
> We recommended checking out the article "[Work item exception handling](https://robocorp.com/docs/development-guide/control-room/work-items#work-item-exception-handling)" before diving in.
### Local testing
For best experience to test the work items in this example we recommend using [our VS Code extensions](https://robocorp.com/docs/developer-tools/visual-studio-code). With the Robocorp Code extension you can simply run and [select the input work items](https://robocorp.com/docs/developer-tools/visual-studio-code/extension-features#using-work-items) to use, create inputs to simulate error cases and so on.