Multithreading & processing worker that executes functions and prints the result
Project description
BotBoy
Multithreading & processing worker that executes functions and prints the result
Installation
pip install botboy
Usage
Create a new BotBoy object with a pre-defined function object and a name
from botboy import BotBoy
bot = BotBoy('Adder', lambda x, y: x + y)
Display the information
bot.display_information()
Adder
<function at 0x10e6e8040>
Execute function object on separate thread
bot.execute(1, 2)
Adder is executing task: <function at 0x10e6e8040>
Retrieved result from Adder: 3
Execute function object on separate process
bot.set_processing() # Can be turned back to thread by running same method
bot.execute(3, 4)
Adder is executing task: <function at 0x10e6e8040>
Retrieved result from Adder: 7
Store result in file result.txt
bot.set_on_file() # Can be turned back to off by running same method
bot.execute(7, 8)
Adder is executing task: <function at 0x10a1e2040>
Retrieved result from Adder: 15
Storing result in file: result.txt
Test
Runs the tests on the core module
make test
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
Built Distribution
Hashes for botboy-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e762089a38f99c80a4a85b17e66050e20acfb2188dd5f20f8c5a6885b6353f |
|
MD5 | 3e5d4c608c568e5186f8b5da84fbfa38 |
|
BLAKE2b-256 | 8ac63b5c9eed457ab61db26ac03313d53b3730834f57ab4acd3875cc25330adf |