# socketry/async

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/socketry-async).**

2,447 stars · 105 forks · Ruby · MIT

## Links

- GitHub: https://github.com/socketry/async
- awesome-repositories: https://awesome-repositories.com/repository/socketry-async.md

## Topics

`async` `asynchronous` `ruby`

## Description

This project is a framework for building concurrent, event-driven applications in Ruby. It provides a core engine that orchestrates non-blocking input and output operations, allowing developers to handle high-volume network traffic and system tasks without the complexity of traditional callback-based programming. By leveraging lightweight fibers, the library enables cooperative multitasking that maintains responsiveness during heavy data processing workloads.

The framework distinguishes itself through a structured concurrency model that organizes tasks into parent-child hierarchies. This approach ensures predictable task lifecycles, reliable error propagation, and automatic resource cleanup. It also includes advanced scheduling capabilities, such as load-based task throttling and periodic background execution, which allow the runtime to manage system resources dynamically while maintaining high throughput.

Beyond its core execution model, the project offers a comprehensive suite of tools for managing shared state and observability. It provides thread-safe synchronization primitives, such as mutexes and communication channels, to coordinate data flow between concurrent operations. Developers can also utilize built-in diagnostic features, including performance profiling, interactive state inspection, and real-time visualization of task hierarchies, to monitor system health and identify execution bottlenecks.

## Tags

### Web Development

- [Asynchronous Frameworks](https://awesome-repositories.com/f/web-development/web-application-frameworks/ruby-frameworks/asynchronous-frameworks.md) — Provides a framework for building concurrent, event-driven Ruby applications using non-blocking I/O.

### Networking & Communication

- [Asynchronous Connection Handlers](https://awesome-repositories.com/f/networking-communication/network-traffic-managers/asynchronous-connection-handlers.md) — Provides a high-performance event-driven engine for managing thousands of simultaneous network connections within a single process. ([source](https://github.com/socketry/async/blob/main/readme.md))
- [Reactor Patterns](https://awesome-repositories.com/f/networking-communication/reactor-patterns.md) — Provides an event-driven reactor for building concurrent Ruby applications using lightweight fibers.
- [High-Concurrency Networking](https://awesome-repositories.com/f/networking-communication/high-concurrency-networking.md) — Supports building scalable network applications that handle thousands of simultaneous connections efficiently.

### Programming Languages & Runtimes

- [Cooperative Execution Units](https://awesome-repositories.com/f/programming-languages-runtimes/cooperative-execution-units.md) — Implements lightweight fiber-based cooperative multitasking for efficient concurrent execution.
- [Structured Concurrency](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/synchronization-primitives/channel-based-concurrency/fiber-based-schedulers/structured-concurrency.md) — Organizes tasks into hierarchical scopes to ensure reliable lifecycle management and error propagation.
- [Structured Concurrency Managers](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/concurrency/task-orchestration-frameworks/concurrency-management-libraries/structured-concurrency-managers.md) — Manages task lifecycles and hierarchies to ensure reliable execution, resource cleanup, and error propagation.
- [Event Loop Scheduling](https://awesome-repositories.com/f/programming-languages-runtimes/event-loop-scheduling.md) — Exposes granular interfaces for embedding the event loop within custom control flows.
- [Background Task Management](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/background-task-management.md) — Supports background operations that do not prevent the event loop from exiting. ([source](https://socketry.github.io/async/guides/tasks/index))
- [Runtime Exception Handling](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-exception-handling.md) — Captures and propagates errors within tasks to ensure system stability. ([source](https://socketry.github.io/async/guides/tasks/index))

### Software Engineering & Architecture

- [Fiber-Based Concurrent Execution](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-task-execution/fiber-based-concurrent-execution.md) — Leverages lightweight fibers to handle high-volume network communication without callback complexity.
- [Structured Concurrency Hierarchies](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-task-runners/structured-concurrency-hierarchies.md) — Organizes asynchronous workflows into hierarchical task trees to ensure reliable lifecycle tracking and error propagation.
- [Non-Blocking Event Loops](https://awesome-repositories.com/f/software-engineering-architecture/non-blocking-event-loops.md) — Integrates non-blocking I/O hooks into the event loop to prevent execution stalls.
- [Reactor Pattern Event Loops](https://awesome-repositories.com/f/software-engineering-architecture/reactor-pattern-event-loops.md) — Orchestrates non-blocking system operations and schedules concurrent tasks to maintain high throughput.
- [Asynchronous Task Cancellation](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-cancellation.md) — Supports immediate termination of active tasks and their children to prevent unnecessary work. ([source](https://socketry.github.io/async/guides/tasks/index))
- [Task Completion Barriers](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-models/asynchronous-task-execution/scoped-task-synchronization/task-completion-barriers.md) — Provides barriers and conditions to coordinate task execution and manage dependencies. ([source](https://socketry.github.io/async/))
- [Concurrency Synchronization Primitives](https://awesome-repositories.com/f/software-engineering-architecture/concurrency-synchronization-primitives.md) — Provides synchronization primitives like mutexes to coordinate access to shared resources in concurrent environments. ([source](https://socketry.github.io/async/guides/thread-safety/index))
- [Non-blocking I/O](https://awesome-repositories.com/f/software-engineering-architecture/concurrent-task-execution/non-blocking-i-o.md) — Hooks into native blocking operations to automatically suspend and resume tasks during I/O. ([source](https://socketry.github.io/async/guides/scheduler/index))
- [CSP Communication Channels](https://awesome-repositories.com/f/software-engineering-architecture/csp-communication-channels.md) — Implements communication channels for safe data exchange between concurrent tasks with support for back-pressure. ([source](https://socketry.github.io/async/guides/best-practices/index))
- [Runtime Event Loop Controls](https://awesome-repositories.com/f/software-engineering-architecture/event-loop-configuration/runtime-event-loop-controls.md) — Enables orchestration of the event loop by managing wait times and iteration control. ([source](https://socketry.github.io/async/guides/scheduler/index))
- [Fiber-local State Management](https://awesome-repositories.com/f/software-engineering-architecture/fiber-local-state-management.md) — Isolates state within individual execution fibers to prevent data leakage between concurrent tasks. ([source](https://socketry.github.io/async/guides/thread-safety/index))
- [Parallel Task Execution](https://awesome-repositories.com/f/software-engineering-architecture/parallel-task-execution.md) — Distributes compute-intensive workloads across parallel execution contexts while maintaining a unified asynchronous model.
- [Recurring Task Schedulers](https://awesome-repositories.com/f/software-engineering-architecture/recurring-task-schedulers.md) — Executes recurring background tasks at fixed intervals without blocking the main application flow. ([source](https://socketry.github.io/async/))
- [Request Timeout Management](https://awesome-repositories.com/f/software-engineering-architecture/request-timeout-management.md) — Enforces maximum durations for asynchronous operations to prevent indefinite blocking during network or system tasks. ([source](https://socketry.github.io/async/guides/tasks/index))
- [Concurrency Limiting](https://awesome-repositories.com/f/software-engineering-architecture/shared-resource-synchronization/concurrency-limiting.md) — Restricts simultaneous operations to prevent resource exhaustion during high-volume processing. ([source](https://socketry.github.io/async/guides/best-practices/index))
- [Task Result Aggregation](https://awesome-repositories.com/f/software-engineering-architecture/task-result-aggregation.md) — Allows execution flows to pause until asynchronous tasks complete and return results. ([source](https://socketry.github.io/async/guides/getting-started/index))
- [Thread-Safe State Containers](https://awesome-repositories.com/f/software-engineering-architecture/thread-safe-state-containers.md) — Provides thread-safe synchronization primitives like mutexes and channels for coordinating concurrent data flow.
- [Load-Aware Throttling](https://awesome-repositories.com/f/software-engineering-architecture/throttling-utilities/load-aware-throttling.md) — Dynamically throttles background tasks based on real-time system load to maintain optimal performance. ([source](https://socketry.github.io/async/guides/best-practices/index))

### Operating Systems & Systems Programming

- [Non-Blocking I/O Interfaces](https://awesome-repositories.com/f/operating-systems-systems-programming/asynchronous-i-o-libraries/non-blocking-i-o-interfaces.md) — Provides non-blocking input and output operations to maintain responsiveness during heavy data processing. ([source](https://socketry.github.io/async/))

### System Administration & Monitoring

- [Resource Cleanup Handlers](https://awesome-repositories.com/f/system-administration-monitoring/task-management/resource-cleanup-handlers.md) — Ensures reliable cleanup of system resources by wrapping operations within task-aware blocks. ([source](https://socketry.github.io/async/guides/tasks/index))
