pollster

Minimal Rust async executor that blocks the thread until a future completes

Library
Cargo
v1.0.1
716stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
55/100Fair
Development Activity56
Maintenance28
Community48
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
83/100Excellent
Architecture82
Code Quality85
Innovation74
Learning Curve92

pollster is an incredibly minimal async executor for Rust whose sole job is to block the current thread until a future resolves. With a single block_on call you can evaluate an async expression from synchronous code without pulling in a full runtime like Tokio or async-std.

Built around the UNIX do-one-thing-well ethos, pollster has essentially no dependencies and adds negligible compile time. It is ideal for tests, small CLI tools, examples, and any synchronous context that occasionally needs to drive an async function to completion.

What You Get

  • A block_on function to drive any future to completion
  • A FutureExt trait adding .block_on() to futures
  • An optional macro feature for a main-style attribute
  • Near-zero dependencies and minimal compile-time cost
  • A tiny, auditable single-file implementation

Common Use Cases

  • Calling an async function from synchronous code or main
  • Driving futures in unit and integration tests
  • Running async operations in small CLI tools without a runtime
  • Evaluating a one-off future without spinning up Tokio

Under The Hood

Architecture - The entire executor is a single src/lib.rs. block_on parks the calling thread and repeatedly polls the future using a lightweight Waker built on a std Mutex/Condvar pair: when the future returns Pending, the thread sleeps until the waker signals readiness, then polls again until Ready. There is no task queue, reactor, or thread pool; it drives exactly one future on the current thread.

Tech Stack - Rust (2018 edition, rust-version 1.69) organized as a small Cargo workspace with the core crate and an optional pollster-macro member behind the macro feature. The core has no runtime dependencies beyond std; dev-dependencies (tokio, futures-timer) exist only for tests.

Code Quality - Despite its tiny size the crate has a tests/ directory, CHANGELOG, and CI via GitHub Actions. Because the implementation is a single well-documented file with no unsafe async machinery, it is trivially auditable and has proven extremely stable across the ecosystem.

API Design - The API is about as small as it gets: import FutureExt and call future.block_on(), or use the free block_on function. This immediacy is the whole point, and rustdoc plus the README example make the one concept clear. The only thing to understand is its intended scope, since it does not provide timers, I/O, or concurrency.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search