Intent Bus is a dead-simple job bus designed for seamless script coordination without the infrastructure overhead. It allows developers to post jobs that can be picked up by any script, anywhere, making automation easy and efficient. Replace heavy message queues with a lightweight SQLite-backed solution that meets all script coordination needs.
Intent Bus is a lightweight and efficient job bus designed for seamless automation across devices. By utilizing a simple SQLite backend, it serves as an ideal solution for developers seeking reliable script coordination without the complexities of traditional message queues like Redis or RabbitMQ.
Key Features
- Efficient Coordination: Easily post a job that any script can pick up and execute, fostering cross-device automation.
- Atomic Locks: The atomic locking feature ensures that each job is claimed and executed by only one worker at a time, preventing race conditions.
- Topic Routing: Workers can claim jobs based exclusively on their specified goals, enhancing efficiency in job handling.
- Automatic Re-queueing: Jobs that are not fulfilled within 60 seconds automatically reset, ensuring that none are lost due to processing failures.
- Rate Limiting: The system enforces a limit of 60 requests per minute per key and IP combination to prevent abuse.
- Security: All operations require an
X-API-Keyauthorization, which is stored securely on the server, ensuring safe access.
How It Works
Implementing the Intent Bus is straightforward:
-
Push a Job Intent: Submit a job using a simple POST request:
curl -X POST https://dsecurity.pythonanywhere.com/intent \ -H "Content-Type: application/json" \ -H "X-API-Key: your_key_here" \ -d '{"goal":"send_notification","payload":{"message":"Hello from the cloud"}}' -
Claim the Intent (Worker): Workers poll for available jobs matching their goals:
curl -s -X POST https://dsecurity.pythonanywhere.com/claim?goal=send_notification \ -H "X-API-Key: your_key_here"Example response:
{ "id": "abc123", "goal": "send_notification", "payload": { "message": "Hello from the cloud" } } -
Fulfill the Intent: Complete the task with the following command:
curl -s -X POST https://dsecurity.pythonanywhere.com/fulfill/abc123 \ -H "X-API-Key: your_key_here"
Example Use Cases
- Trigger notifications on your phone from a remote scraper's completion.
- Manage multiple scripts without the hassle of hardcoded dependencies.
- Simplify and replace complex cron jobs with loosely-coupled worker scripts.
- Enable automation across devices without relying on Firebase or traditional message queues.
- Leverage Termux workers for executing jobs on an Android phone from a cloud server.
Community Contributions
Upcoming worker scripts for community engagement include:
- Discord Alert
- Free SMS Gateway
- Uptime Watchdog
- Webhook Relay
Try It Live
A live version of Intent Bus is available for use at https://dsecurity.pythonanywhere.com. For those interested in testing, free API keys can be requested through Dev.to or by reaching out via GitHub Issues.
Update: v7 is Live Since the original post, Intent Bus has been hardened significantly based on real-world feedback:
Rate limiting (60 req/min per key+IP) Tester key system — request a free key to try the live instance Intent expiry after 24 hours Python worker for non-bash users Security headers and payload size limits DM me on Dev.to, open a GitHub Issue, or join the Discord to request a free tester key: https://discord.gg/bzAneAQzGX
Update: The Python SDK is officially live on PyPI. pip install intent-bus GitHub: https://github.com/dsecurity49/intent-bus-sdk
Sign in to comment.