amphp/amp is a PHP library providing fundamental asynchronous concurrency primitives: Futures (promises) and Cancellations. It is built on top of the Revolt event loop and leverages PHP 8.1 fibers for cooperative multitasking, eliminating the need for generator-based coroutines or callback-heavy APIs. The library offers a Future class with methods like map(), catch(), finally(), and await() for composing asynchronous operations, along with combinators (await, awaitFirst, awaitAny, awaitAnyN, awaitAll) for concurrent execution. Cancellation is handled via a clean interface with implementations for timeouts (TimeoutCancellation), OS signals (SignalCancellation), manual cancellation (DeferredCancellation), and composition (CompositeCancellation). Utility functions include async() for spawning fibers, delay() for non-blocking sleep, trapSignal() for awaiting signals, and weakClosure() to prevent circular references in closures. The architecture is modular, with internal state management separated from public APIs, and strict typing throughout. External dependency is limited to revolt/event-loop for the event loop and suspension API.
TqSdk (倩ε€ιε) is a comprehensive Python SDK for quantitative trading in Chinese futures, options, and stock markets. It provides real-time market data via WebSocket, multi-broker account management (CTP, simulation, backtest), order execution, position management, and a full backtesting engine with replay capabilities. The architecture follows a client-server diff protocol: the SDK maintains an in-memory snapshot of business data (quotes, orders, positions) and processes incremental updates delivered via an async event loop. Users write strategies as Python scripts using `TqApi`, `wait_update()`, and helper classes like `TargetPosTask`. The SDK includes a rich set of demo strategies, technical indicators (60+), options pricing (Black-Scholes Greeks), risk management rules, scenario trials, and a web GUI for visualization. It also provides AI skill packs for integration with coding assistants. While primarily an application library, it contains strong data engineering components for time-series handling and backtesting.
Gears is an experimental asynchronous programming library for Scala 3 that enables direct-style async programming with structured concurrency. It provides Futures for concurrent computations, Channels for communication between computations, and an Async context for managing execution. The library works across JVM (with virtual threads), Scala Native, and Scala.js (with Wasm support), implementing structured concurrency principles with automatic cancellation propagation. The architecture features a shared core with platform-specific implementations, using delimited continuations or fibers for suspension/resume operations.
This is a Rust library that provides safe, idiomatic bindings over the C library librdkafka, enabling Rust applications to produce and consume messages from Apache Kafka. The architecture is a thin wrapper: it exposes a high-level typed API (producers, consumers, admin client, transactions) while delegating all network I/O, partition management, and protocol handling to librdkafka. Key entry points include `ClientConfig` for building clients, the `Consumer` and `Producer` traits, and concrete implementations (`BaseConsumer`, `StreamConsumer`, `BaseProducer`, `FutureProducer`, `ThreadedProducer`). Data flows through a polling loop that dispatches events (delivery reports, rebalance notifications, log messages) to user-provided `ClientContext` callbacks. External dependencies are the librdkafka native library (bundled via submodule or system) and optional async runtimes (Tokio, smol, async-std). The library is heavily used in production Rust Kafka deployments.
Smol is a lightweight async runtime for Rust that bundles several well-known subcrates (async-executor, async-io, async-net, async-fs, async-process, async-channel, async-lock, blocking, futures-lite) into a single convenient dependency. It provides a global executor initialized lazily with configurable thread count via the SMOL_THREADS environment variable, and exposes a simple API (smol::spawn, smol::block_on, smol::Async, smol::Timer, smol::Unblock, etc.) for writing async programs. The source code itself is thinβprimarily re-exports from subcrates plus a spawn module that sets up the global executor. This makes smol an excellent entry point for Rust async development without the complexity of larger runtimes like tokio. The repository includes a rich set of examples covering TCP, TLS, HTTP, WebSocket, file I/O, process management, and platform-specific features like inotify and timerfd. The codebase is well-maintained, uses modern Rust practices (edition 2021, MSRV 1.85, no unsafe), and has active CI and dependabot configuration.
This repository is a Rust library providing structured concurrency primitives for async programming. It offers operations such as `join`, `race`, `try_join`, `race_ok` for futures, and `merge`, `chain`, `zip` for streams, supporting tuples up to 12 elements, arrays, and `Vec` (with alloc feature). It also includes `FutureGroup` and `StreamGroup` for dynamic collections, and a `ConcurrentStream` trait for processing streams concurrently with backpressure and bounded concurrency. The library is runtime-agnostic (works with tokio, async-std, smol, etc.) and supports `no_std` environments. The code extensively uses pin projection, `ManuallyDrop`, and custom waker arrays with bit-set readiness tracking to achieve efficient polling and cancellation. It provides benchmark comparisons against `futures-rs` demonstrating competitive performance. There are no data pipelines, notebooks, or research elements; this is a pure library for async concurrency.
This repository is a Chinese futures algorithmic trading system centered on the CTP (Commodity Trading Platform) native protocol. It comprises a C++ pybind11 bridge for low-latency market data and order execution, Python trading strategies (e.g., channel breakout, experimental transformer-based models), and a Django web dashboard for monitoring positions, orders, signals, performance, and correlations. The architecture is hybrid: the native module handles real-time CTP communication, while Python strategies run on an in-process event bus with Redis-like pub/sub. The dashboard visualizes trading metrics with ECharts and provides admin CRUD via Django admin. The system is production-oriented but exhibits several maintenance concerns: hardcoded secrets, outdated frontend libraries (Bootstrap 3, jQuery 3.1), duplicate config loading, and an incomplete ML integration. Despite these, the core CTP bridge and strategy framework are well-constructed and demonstrate solid engineering for the niche domain of Chinese futures trading.