Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding idle and polling mechanism to imap #1196

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Shadow243
Copy link
Member

@Shadow243 Shadow243 commented Aug 25, 2024

Summary

This PR introduces a backend service that includes:

  • Event dispatching system for triggering and handling system-wide events.
  • Task scheduling using cron-like jobs with overlapping prevention.
  • Real-time notifications via multiple channels (e.g., Telegram, SMS, Slack).
  • Ratchet PHP lib integration

Key Features

  • Event Class: Implements an event dispatching system where events can be defined and dispatched across the system. This allows for decoupled execution of processes in response to events.

  • Scheduler: Manages task scheduling with cron-like expressions, mutex handling to prevent task overlapping, and timezone support.

  • Commands: Defines and executes registered commands with dependency injection support.

  • Notifications: Notification system with extensible drivers for various channels (e.g., Telegram, SMS, Slack). It allows sending notifications based on event triggers such as new emails.

  • Listeners: Allows the system to react to dispatched events by triggering actions such as notifications or logging.

Example Usage Command

Screenshot 2024-10-24 at 23 35 06

@Shadow243 Shadow243 force-pushed the imap-idle-polling-mechanism branch 5 times, most recently from e5e3470 to b84879e Compare October 24, 2024 20:18
console Outdated


// Load the application dependencies and bootstrap the application
require_once __DIR__ . '/index.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Load the dependencies here and don't include index.php. Treat console as a separate entry point in the application. index.php will be for web requests and this one for cli.

composer.json Outdated
@@ -38,6 +38,7 @@
"bacon/bacon-qr-code": "^1.0.3 || ^2.0.0",
"christian-riesen/base32": "^1.3.2",
"composer": "^2.0.0",
"cypht/cli-service": "*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we define another package? It doesn't seem to be runnable without main cypht repo, so better stay as just a subdirecrory in this repo. No need for composer dependencies here.

@kroky
Copy link
Member

kroky commented Oct 25, 2024

Please ping me when you add the ratchet lib and polling, so I can review again.

@Shadow243 Shadow243 force-pushed the imap-idle-polling-mechanism branch 2 times, most recently from 50ba3df to 60b0bd3 Compare October 26, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants