Skip to content

Releases: Smithay/calloop

v0.14.2

12 Dec 03:37
v0.14.2
Compare
Choose a tag to compare

0.14.2 -- 2024-12-03

Bugfixes

  • Simplify the way timeouts are calculated for Poll. (#214)

v0.14.1

07 Sep 17:45
v0.14.1
Compare
Choose a tag to compare

0.14.1 -- 2024-09-05

Additions

  • Use the tracing crate for logging instead of the log crate. (#195)
  • Make the Generic type UnwindSafe, even if its error is not. (#204)

Bugfixes

  • Optimizer timers in such a way that cancelling and restarting a timer doesn't
    allocate on the heap. (#184)
  • Make it so the number of channel elements are bounded per iteration of the
    event loop. (#200)

v0.14.0

04 Jun 02:51
v0.14.0
Compare
Choose a tag to compare

0.14.0 -- 2024-06-01

Breaking Changes

  • Remove nix from the public API. This replaces Signal with a home-grown
    Signal enum and siginfo with a structure that provides most of its fields. (#182)
  • Replace thiserror usage with manual implementations. This may cause the API to be slightly different in some cases, but should mostly be identical. (#186)

Additions

  • Improve the MSRV policy. Now, changes to the MSRV are no longer considered breaking changes, improving stability. (#189)

Bugfixes

  • Bump nix to v0.29. (#188)

v0.13.0

01 Mar 02:42
v0.13.0
Compare
Choose a tag to compare

0.13.0 -- 2024-02-25

Breaking changes

  • Bump nix to v0.28. As nix is exposed in the public API, this is a
    breaking change. (#176)

Bugfixes

  • Fix a panic that would occur when a task is scheduled in an event callback.
    (#172)

v0.12.4

15 Jan 20:21
v0.12.4
cd9c3f3
Compare
Choose a tag to compare

0.12.4 -- 2024-01-15

Additions

  • calloop is now supported for Windows. (#168)
  • Add the signals feature to docs.rs. (#166)

Bugfixes

  • Fix a borrow error that can occur while using the executor. (#165)

v0.10.0

06 May 16:59
v0.10.0
0d3b13a
Compare
Choose a tag to compare

This release brings a lot of deep changes to calloop, the highlights being:

Error handling is revamped: The error handling machinery of calloop has been completely revamped (thanks to @detly). A calloop::Error type is introduced, and the EventSource trait now has an Error associated type. Each event source now has its own error type.

Timer sources rework: Timer event sources are completely reworked, making them more flexible and integrating them directly into the event loop core logic, thus avoiding to spawn a background thread to manage them. This also introduces a "high-precision mode" for the event loop allowing sub-millisecond accuracy for the timers, it is obtained by initializing it with the try_new_high_precision() method.

Several other changes were introduced in this release:

  • The MSRV is bumped to 1.53.0
  • The generic::Fd adapter is now removed, as RawFd implements AsRawFd, making Generic<RawFd> usable.
  • The internal logic of calloop has been reworked around a slotmap, making the RegistrationToken now Copy. This causes a breaking change to the low-level Poll API.
  • The PingSource event source now uses an eventfd instead of a pipe on Linux (thanks to @detly).

Version 0.7.0

13 Oct 14:35
v0.7.0
0298796
Compare
Choose a tag to compare

This new release of calloop brings two major changes: many 'static requirements were lifted from the API, and calloop now provides adapters to integration with the async/await ecosystem.

Lifetimes relaxation

Thanks to @fengalin in PR #20, EventSource objects and their associated callback are no longer required to be 'static, as long as they outlive the EventLoop. It was necessary to adapt a little calloop's API to make this possible, and as a result this is a breaking change.

The most notable change is that LoopHandle::with_source was removed. If you need to access an EventSource after its insertion into the EventLoop, you now instead need to create a Dispatcher and insert it using LoopHandle::register_dispatcher. The Dispatcher holds both an event source and its associated callback, allows you to mutably access the event source, and can be cloned, allowing you to provide it to the event queue and still keep it.

Async/await integration

With this release calloop now provide two tools for integration with the async/await ecosystem: Futures-aware IO and an future executor.

Future-aware IO is provided by the LoopHandle::adapt_io method, which turns an IO object F into an Async<F> adapter, which provides access to futures that resolve when the object is ready for read or write, as well as implementations of the AsyncRead and AsyncWrite traits from the futures crates if the futures-io cargo feature is enabled. This adapter uses the associated EventLoop to awake the futures when IO is ready, allowing the whole construct to run single-threaded.

The future executor is provided as yet another EventSource implementation behind the executor cargo feature, which introduces the std::futures module containing it. The executor has a T type parameter, and can only run futures that resolve to a value of this type. Every time a future spawned in the executor resolves, its value is forwarded to the callback associated to it in the EventLoop. A generic executor for futures that don't return any value can thus be obtained by taking T = ().