
Research
/Security News
60 Malicious Ruby Gems Used in Targeted Credential Theft Campaign
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
A lightweight task execution system for concurrent operations in Python. This package provides a simple yet powerful interface for creating and managing concurrent tasks using Python's ThreadPoolExecutor.
pip install pytaskexec
from pytaskexec import TaskRunner, taskify
import time
# Create a task using the decorator
@taskify
def process_data(item, delay=1):
time.sleep(delay) # Simulate work
return f"Processed {item}"
# Create a TaskRunner
with TaskRunner(max_workers=3) as runner:
# Schedule multiple tasks
task_ids = [
runner.schedule(process_data(f"item_{i}"))
for i in range(5)
]
# Get results as they complete
for tid in task_ids:
result = runner.get_result(tid)
print(result)
There are two ways to create tasks:
@taskify
decorator:@taskify
def my_task(x, y):
return x + y
task = my_task(1, 2) # Creates a Task object
wrap_as_task
function:from pytaskexec import wrap_as_task
def my_function(x, y):
return x + y
task = wrap_as_task(my_function, 1, 2) # Creates a Task object
with TaskRunner(name="my_runner", max_workers=5) as runner:
# Schedule tasks
tid1 = runner.schedule(my_task(1, 2))
tid2 = runner.schedule(my_task(3, 4))
# Wait for specific tasks
runner.block(taskids=[tid1, tid2])
# Get results with timeout
try:
result = runner.get_result(tid1, timeout=5)
except concurrent.futures.TimeoutError:
runner.cancel_task(tid1)
# Cancel all pending tasks
runner.cancel_pending()
Set the environment variable PYTASKEXEC_DEBUG
to enable debug logging:
export PYTASKEXEC_DEBUG=1 # Linux/Mac
set PYTASKEXEC_DEBUG=1 # Windows
git clone https://github.com/anandan-bs/pytaskexec.git
cd pytaskexec
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
pytest tests/
This project uses:
This project is licensed under the MIT License. See the LICENSE file for details.
FAQs
A lightweight task execution system for concurrent operations in Python
We found that pytaskexec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.