[PR #1196] feat(backend): adding idle and polling mechanism to imap #1331

Open
opened 2026-02-25 21:37:57 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1196
Author: @Shadow243
Created: 8/25/2024
Status: 🔄 Open

Base: masterHead: imap-idle-polling-mechanism


📝 Commits (10+)

  • 3aa6f7a Console commands added
  • 1becf62 Refactored cli-service structure
  • dea1ba1 Job & Queue added with multiple drivers
  • 05ff9c6 Events & listeners, Scheduling added
  • 4e0dad1 Adding Notifications
  • 29481ae add Singleton Class for containerBuilder
  • db21774 Refactor queue worker command & adding error handling
  • 895ad7a Queue manager: dispatching jobs to queue
  • 920a1aa Complete Database queue driver and tested in real scenario
  • 7a21533 Sqs & Redis queue driver completed and tested

📊 Changes

84 files changed (+6317 additions, -429 deletions)

View changed files

📝 .env.example (+34 -0)
📝 composer.json (+18 -1)
📝 composer.lock (+1787 -400)
📝 config/app.php (+0 -20)
config/broadcasting.php (+7 -0)
config/queue.php (+13 -0)
config/redis.php (+22 -0)
config/services.php (+26 -0)
config/sqs.php (+9 -0)
console (+97 -0)
📝 index.php (+4 -2)
📝 lib/cache.php (+17 -1)
📝 lib/db.php (+5 -0)
📝 lib/framework.php (+1 -0)
📝 lib/ini_set.php (+1 -1)
lib/sqs.php (+140 -0)
📝 modules/imap/handler_modules.php (+47 -0)
📝 modules/imap/output_modules.php (+4 -2)
📝 modules/imap/setup.php (+15 -0)
📝 modules/imap/site.js (+65 -1)

...and 64 more files

📄 Description

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 using database queue driver

Screenshot 2024-10-31 at 21 14 09

Example Usage Command using sqs queue driver

Screenshot 2024-11-01 at 05 19 16 Screenshot 2024-11-01 at 05 42 53

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1196 **Author:** [@Shadow243](https://github.com/Shadow243) **Created:** 8/25/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `imap-idle-polling-mechanism` --- ### 📝 Commits (10+) - [`3aa6f7a`](https://github.com/cypht-org/cypht/commit/3aa6f7aaf1d02fd2c46bcdbd3a8f7e3d115acefe) Console commands added - [`1becf62`](https://github.com/cypht-org/cypht/commit/1becf624cbe3b0d5b7242ca3852e44cdc13856e5) Refactored cli-service structure - [`dea1ba1`](https://github.com/cypht-org/cypht/commit/dea1ba17a71141d7f279cd818c85eec23de719be) Job & Queue added with multiple drivers - [`05ff9c6`](https://github.com/cypht-org/cypht/commit/05ff9c6228c121e4590d937648d57686e09f5000) Events & listeners, Scheduling added - [`4e0dad1`](https://github.com/cypht-org/cypht/commit/4e0dad1bf3f48ad5b6de9f79d595a9b70aaf165e) Adding Notifications - [`29481ae`](https://github.com/cypht-org/cypht/commit/29481aeba742d88485fe6d25ed2b8856bd8ac388) add Singleton Class for containerBuilder - [`db21774`](https://github.com/cypht-org/cypht/commit/db21774a615a65a886e75177d91db635af3a4a8e) Refactor queue worker command & adding error handling - [`895ad7a`](https://github.com/cypht-org/cypht/commit/895ad7a3ed53ca2809a16d38af56f7557ccaf58e) Queue manager: dispatching jobs to queue - [`920a1aa`](https://github.com/cypht-org/cypht/commit/920a1aa16c4c98474c9c45b623fdd5ffc247b4a6) Complete Database queue driver and tested in real scenario - [`7a21533`](https://github.com/cypht-org/cypht/commit/7a21533637a8c57de3ecaa5e82d48113893e8e8e) Sqs & Redis queue driver completed and tested ### 📊 Changes **84 files changed** (+6317 additions, -429 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+34 -0) 📝 `composer.json` (+18 -1) 📝 `composer.lock` (+1787 -400) 📝 `config/app.php` (+0 -20) ➕ `config/broadcasting.php` (+7 -0) ➕ `config/queue.php` (+13 -0) ➕ `config/redis.php` (+22 -0) ➕ `config/services.php` (+26 -0) ➕ `config/sqs.php` (+9 -0) ➕ `console` (+97 -0) 📝 `index.php` (+4 -2) 📝 `lib/cache.php` (+17 -1) 📝 `lib/db.php` (+5 -0) 📝 `lib/framework.php` (+1 -0) 📝 `lib/ini_set.php` (+1 -1) ➕ `lib/sqs.php` (+140 -0) 📝 `modules/imap/handler_modules.php` (+47 -0) 📝 `modules/imap/output_modules.php` (+4 -2) 📝 `modules/imap/setup.php` (+15 -0) 📝 `modules/imap/site.js` (+65 -1) _...and 64 more files_ </details> ### 📄 Description ### 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 using database queue driver <img width="806" alt="Screenshot 2024-10-31 at 21 14 09" src="https://github.com/user-attachments/assets/9c7bdf31-b45f-4c83-b471-c672793be6a1"> ### Example Usage Command using sqs queue driver <img width="788" alt="Screenshot 2024-11-01 at 05 19 16" src="https://github.com/user-attachments/assets/bfbbee97-d05a-4103-8111-7e8bd174d021"> <img width="1287" alt="Screenshot 2024-11-01 at 05 42 53" src="https://github.com/user-attachments/assets/0ffb47a2-5a2d-4e13-a7e6-b7773685e10b"> - Related Issue: [https://github.com/cypht-org/cypht/issues/178](https://github.com/cypht-org/cypht/issues/178) - Related PR: [https://github.com/cypht-org/cypht/pull/1056](https://github.com/cypht-org/cypht/pull/1056) - Related RFC: [https://datatracker.ietf.org/doc/html/rfc2177](https://datatracker.ietf.org/doc/html/rfc2177) - Related RFC: [https://datatracker.ietf.org/doc/html/rfc822](https://datatracker.ietf.org/doc/html/rfc822) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1331
No description provided.