Event Loop#

Summary of yev_loop#

The yev_loop module provides an event loop implementation for managing asynchronous events within Yunetas. It serves as the foundation for handling non-blocking operations, timers, signals, and file descriptor events efficiently.

The key functionalities include:

  • Event-driven Architecture: Manages multiple sources of events in a single loop.

  • Asynchronous I/O Handling: Supports file descriptors and sockets for non-blocking operations.

  • Timers and Scheduling: Allows precise timing control for executing delayed or periodic tasks.

  • Efficiency: Uses ui_uring.

yev_loop acts as the core event dispatcher for GObj-based applications, ensuring responsiveness and high performance in Yunetas-based systems.


Philosophy of yev_loop#

The design of yev_loop aligns with Yunetas’ core principles:

  1. Event-Driven Design:

    • In Yunetas, nothing happens without an event.

    • yev_loop is the mechanism that processes and propagates these events, ensuring actions occur in response to meaningful triggers.

  2. Non-Blocking and Reactive System:

    • Rather than waiting for operations to complete (which would waste CPU cycles), yev_loop efficiently reacts to events when they occur.

    • This allows Yunetas applications to handle multiple I/O operations simultaneously, optimizing system performance.

  3. Time and Event Synchronization:

    • yev_loop enforces the principle that everything occurs within the dimension of time.

    • Events and actions are processed in an orderly manner, ensuring controlled execution.

  4. Scalability and Efficiency:

    • By abstracting platform-specific polling mechanisms, yev_loop provides a scalable event management system adaptable to various operating environments.

    • This supports high-concurrency applications without the overhead of traditional multi-threading.

  5. Minimalist and Robust:

    • Keeping the loop lightweight and efficient ensures it remains stable under high loads.

    • It integrates seamlessly with Yunetas’ GObj framework, maintaining a clean separation of concerns.

  6. Hierarchical and Self-Managing:

    • In Yunetas, objects are hierarchically structured. yev_loop adheres to this by managing event-driven dependencies in a structured manner.

    • Self-healing capabilities (e.g., re-launch mechanisms) align with Yunetas’ philosophy of resilience.

Conclusion#

yev_loop is the heartbeat of Yunetas’ event-driven system, ensuring that events are processed efficiently while maintaining scalability, reliability, and responsiveness. It embodies the Yunetas philosophy that “without events, nothing happens” and seamlessly integrates with the GObj architecture to facilitate asynchronous operations in a structured and efficient manner.