calloop
A callback-based event loop
0.14.4
55M downloads/mo
#1155 most downloaded on crates.io
Smithay/calloop
What this package is like to depend on
Last release 6 months ago
13 Feb 2026
Ships fairly regularly
a new release about every 3 months
Most releases are documented
notes for 40 of 46 stable releases
2 versions withdrawn
withdrawn after publishing
8 years old
48 releases · first in 2018
1 release in the last 12 months
see the full history below
Release timeline
48 releases · Aug 2018 to Feb 2026Releases
latest 48-
0.14.413 Feb 2026Release notes
Open source →Additions
- Add
StreamSourceto adapt an asyncStreamto anEventSource. (#228) - Bump MSRV to 1.71.1 in accordance with dependencies.
Bugfixes
Release notes
Open source →Additions
- Add
StreamSourceto adapt an asyncStreamto anEventSource. (#228) - Bump MSRV to 1.71.1 in accordance with dependencies.
Bugfixes
- Fix handling of
notifiedatomic in futures source. (#227) - Prevent timers from growing indefinitely. (#238)
- Bump
nixto v0.31. (#237) - Ping on drop of last instance of
SyncSender. (#236)
- Add
-
0.14.330 Jul 2025 -
0.14.212 Dec 2024Release notes
Open source → -
0.14.107 Sep 2024Release notes
Open source →0.14.1 -- 2024-09-05
Additions
- Use the
tracingcrate for logging instead of thelogcrate. (#195) - Make the
GenerictypeUnwindSafe, even if its error is not. (#204)
Bugfixes
Release notes
Open source →Additions
- Use the
tracingcrate for logging instead of thelogcrate. (#195) - Make the
GenerictypeUnwindSafe, 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)
- Use the
-
0.14.004 Jun 2024Release notes
Open source →0.14.0 -- 2024-06-01
Breaking Changes
- Remove
nixfrom the public API. This replacesSignalwith a home-grown
Signalenum andsiginfowith a structure that provides most of its fields. (#182) - Replace
thiserrorusage 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
nixto v0.29. (#188)
Release notes
Open source →Breaking Changes
- Remove
nixfrom the public API. This replacesSignalwith a home-grownSignalenum andsiginfowith a structure that provides most of its fields. (#182) - Replace
thiserrorusage 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
nixto v0.29. (#188)
- Remove
-
0.13.001 Mar 2024Release notes
Open source →0.13.0 -- 2024-02-25
Breaking changes
- Bump
nixtov0.28. Asnixis 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)
Release notes
Open source →Breaking changes
- Bump
nixtov0.28. Asnixis 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)
- Bump
-
0.12.415 Jan 2024Release notes
Open source →0.12.4 -- 2024-01-15
Additions
Bugfixes
- Fix a borrow error that can occur while using the executor. (#165)
Release notes
Open source →Additions
calloopis now supported for Windows. (#168)- Add the
signalsfeature todocs.rs. (#166)
Bugfixes
- Fix a borrow error that can occur while using the executor. (#165)
-
0.12.310 Oct 2023Release notes
Open source →Additions
TokenandRegistrationTokenare now invalidated when the event source they represent is removed from the event loop.- Implement
AsRawFdandAsFdforEventLoop<'l, Data>
Bugfixes
- Fix an issue, where id-reuse could execute a PostAction on a newly registered event source
-
0.12.225 Sep 2023Release notes
Open source →Bugfixes
- Fix an issue where the
Genericevent source would try to unregister its contents from the event loop after a failed registration. - Fix an issue where the
EventLoopwould panic when processing aPostAction::Removefrom an event source with subsources.
- Fix an issue where the
-
0.12.119 Sep 2023Release notes
Open source →Bugfixes
- Fix
EventSource::before_handle_events()being erroneously give an iterator over synthetic events instead of real events
- Fix
-
0.12.011 Sep 2023Release notes
Open source →Breaking changes
- Bump MSRV to 1.63
- Make signals an optional feature under the
signalsfeatures. - Replace the
nixcrate with standard library I/O errors and therustixcrate. pre_runandpost_runonEventSourcehave been replaced withbefore_sleepandbefore_handle_events, respectively. These are now opt-in through theNEEDS_EXTRA_LIFECYCLE_EVENTSassociated constant, and occur at slightly different times to the methods they are replacing. This allows greater compatibility with Wayland based event sources.
-
0.11.005 Jun 2023Release notes
Open source →Bugfixes
- Fixed a crash due to double borrow when handling pre/post run hooks
- Fixes a panic that can occur when large
Durations are passed toTimer::from_duration. - Replace the
sysmodule with thepollingcrate.
Additions
- With the
block_onfeature enabled, theEventLoopmethod now has ablock_onmethod that runs a future to completion on the event loop.
Breaking changes
- Bump MSRV to 1.56
- Breaking: The
TransientSourceis now an opaque type. It provides API methods for removing or replacing the wrapped source. This mitigates a potential leak of registration data if the TransientSource is replaced by direct assignment in a parent source. - Breaking:
Timer::current_deadlinereturnsOption<Instant>, so that it can returnNonein the event of an overflow. - Breaking: Use
AsFdinstead ofAsRawFd/RawFd.
-
0.10.605 Jun 2023Nothing published for this version
-
0.10.527 Dec 2022Nothing published for this version
-
0.10.405 Dec 2022Nothing published for this version
-
0.10.316 Nov 2022Nothing published for this version
-
0.10.208 Nov 2022Release notes
Open source →Bugfixes
- The return value of
LoopHandle::insert_idleno longer borrows theLoopHandle.
- The return value of
-
0.10.120 Jun 2022Release notes
Open source →Additions
- The
Channelnow has proxy methods forReceiver::recvandReceiver::try_recv - Enable support for
target_os = "android"
- The
-
0.10.006 May 2022Release notes
Open source →- Breaking: Calloop's internal storage is now backed by a
slotmap. As a result theRegistrationTokenis nowCopy+Clone, and the low-level registration API ofPollis altered in a breaking way. MSRV is bumped to 1.49. - Breaking:
generic::Fdadapter is removed, as since that rust versionRawFdimplementsAsRawFd, allowing it to be used directly inGeneric. - Breaking: The
EventSourcetrait has a new associated typeError. This determines the type of the error variant returned byEventSource::process_events(). It must be convertible intoBox<dyn std::error::Error + Sync + Send>. - Breaking: All library-provided event sources now have their own error types for the
associated
Errortype on theEventSourcetrait. - Breaking: Many API functions now use Calloop's own error type (
calloop::Error) instead ofstd::io::Erroras the error variants of their returned results. - Breaking: The
Timerevent source has been completely reworked and is now directly driven by calloop polling mechanism instead of a background thread. Timer multiplexing is now handled by creating multipleTimers, and self-repeating timers is handled by the return value of the associated event callback. - Breaking: The minimum supported Rust version is now 1.53.0
- Introduce
EventLoop::try_new_high_precision()for sub-millisecond accuracy in the event loop - The
PingSourceevent source now uses aneventfdinstead of a pipe on Linux.
- Breaking: Calloop's internal storage is now backed by a
-
0.9.327 Dec 2021Nothing published for this version
-
0.9.227 Dec 2021 withdrawnRelease notes
Open source →Additions
- Introduce the methods
pre_run()andpost_run()toEventSource, allowing event sources to do preparations before entering a run/dispatch session, and cleanup afterwards. They have default implementations doing nothing.
- Introduce the methods
-
0.9.110 Aug 2021 -
0.9.029 Jun 2021Release notes
Open source →Breaking changes
- MSRV is now 1.41
- The
futuresmodule now has a proper error type forScheduler::schedule() - The return type of
EventSource::process_events()is nowio::Result<PostAction>allowing the sources to directly request the event loop to reregister/disable/destroy them. - The
Tokencreation mechanism is now driven by aTokenFactory, that dynamically generates new unique token for sub-sources. Following for this if you create a new event source that is not built by composing the ones provided by calloop, you need to check if theTokenprovided toprocess_eventsis the same as the one you created when (re)registering your source. If you delegateprocess_eventsto a sub-source, you no longer need to check thesub_idbefore, instead the source you are delegating to is responsible to to this check.
Bugfixes
- Cancelling a timeout no longer prevents later timeouts from firing.
-
0.8.030 May 2021Release notes
Open source →Breaking changes
- The
Dispatchertype no longer has the closure type within its type parameters, but instead now has an explicit lifetime parameter, as well as the source typeSand the event loopDatatype. This allows the type to be explicitly named and stored into an other struct.
Additions
Tokennow has a methodwith_sub_id()that returns a copy of the token but with the givensub_id.
- The
-
0.7.209 Feb 2021Release notes
Open source →Changes
EventLoop::run()now acceptsInto<Option<Duration>>, likeEventLoop::dispatch()
Bugfixes
- The
Pingevent source now automatically disables itself when its sending end is dropped, preventing to always be considered readable (which caused a busy-loop). This also fixes a similar behavior ofExecutorandChannel, which usePinginternally.
-
0.7.129 Dec 2020Nothing published for this version
-
0.7.013 Oct 2020Release notes
Open source →Breaking Changes
- The return type for
LoopHandle::insert_sourcewas renamed asRegistrationTokenand can be used in{enable,disable,update,remove,kill}just like before. - Allow non-
'staticevent sources and callbacks, so they can hold references to other values.LoopHandle::with_sourcewas removed. To achieve the same behaviour, use aDispatcherand register it via theLoopHandle::register_dispatcher. TheEventSourcewill be available usingDispatcher::as_source_{ref,mut}.LoopHandle::removedoesn't return the event source any more. To achieve the same behaviour, use aDispatcherand register it via theLoopHandle::register_dispatcher. After removing theEventSourcewithLoopHandle::remove, you will be able to callDispatcher::into_source_innerto get ownership of theEventSource.LoopHandle::register_dispatchercan be used in place ofLoopHandle::insert_sourcewhen the source needs to be accessed after its insertion in the loop.
Interestis changed into a struct to allow empty interest queries
Additions
- Introduce a futures executor as a new event source, behind the
executorcargo feature. - Introduce the
LoopHandle::adapt_iomethod for creatingAsync<F>adapters to adapt IO objects for async use, powered by the event loop.
- The return type for
-
0.6.507 Oct 2020Release notes
Open source →Fixes
- Channel now signals readinnes after the event has actually been sent, fixing a race condition where the event loop would try to read the message before it has been written.
-
0.6.430 Aug 2020Release notes
Open source →Fixes
- Fix double borrow during dispatch when some event source is getting removed
-
0.6.327 Aug 2020 withdrawnRelease notes
Open source →Aditions
- Add support for
openbsd,netbsd, anddragonfly. InsertError<E>now implementsstd::error::Error.
Changes
- Allow non-
'staticdispatchData.Datais passed as an argument to thecallbacks while dispatching. This change allows definingDatatypes which can hold references to other values. dispatchnow will retry onEINTR.
- Add support for
-
0.6.223 Apr 2020 -
0.6.122 Apr 2020Release notes
Open source →- Introduce
LoopHandle::killto allow dropping a source from within its callback
- Introduce
-
0.6.022 Apr 2020Release notes
Open source →- Drop the
miodependency - Breaking Change: Significantly rework the
calloopAPI, notably:- Event sources are now owned by the
EventLoop - Users can now again set the polling mode (Level/Edge/OneShot)
- Event sources are now owned by the
- Introduce the
Pingevent source
- Drop the
-
0.5.214 Apr 2020Release notes
Open source →channel::Channelis nowSend, allowing you to create a channel in one thread and sending its receiving end to an other thread for event loop insertion.
-
0.5.114 Mar 2020 -
0.5.007 Feb 2020Release notes
Open source →- Update to 2018 edition
- Update
nixdependency to0.17 - Breaking Update
miodependency to0.7.0-alpha.1. The API ofcalloopfor custom event sources significantly changed, and the channel and timer event sources are now implemented incallooprather than pulled frommio-extras.
-
0.4.413 Jun 2019 -
0.4.317 Feb 2019 -
0.4.215 Nov 2018 -
0.4.114 Nov 2018Release notes
Open source →- Disable the
sources::signalmodule on FreeBSD so that the library can be built on this platform.
- Disable the
-
0.4.004 Nov 2018Release notes
Open source →- Breaking Use
mio-extrasinstead ofmio-morewhich is not maintained. - Breaking Reexport
miorather than selectively re-exporting some of its types. - Add methods to
Genericto retrive the innerRcand construct it from anRc - Breaking
LoopHandle::insert_sourcenow allows to retrieve the source on error.
- Breaking Use
-
0.3.225 Sep 2018 -
0.3.124 Sep 2018Release notes
Open source →- introduce
EventedRawFdas a special case for theGenericevent source, for when you really have to manipulate raw fds - Don't panic when the removal of an event source trigger the removal of an other one
- introduce
-
0.3.010 Sep 2018Release notes
Open source →- Fixed a bug where inserting an event source from within a callback caused a panic.
- [breaking] Erase the
Datatype parameter fromSourceandIdle, for improved ergonomics.
-
0.2.210 Sep 2018Release notes
Open source →- Introduce an
EventLoop::runmethod, as well as theLoopSignalhandle allowing to wakeup or stop the event loop from anywhere.
- Introduce an
-
0.2.030 Aug 2018Release notes
Open source →- [breaking] Add a
&mut shared_dataargument toEventLoop::dispatch(..)to share data between callbacks.
- [breaking] Add a
-
0.1.129 Aug 2018Release notes
Open source →Genericevent source for wrapping arbitraryEventedtypes- timer event sources
- UNIX signal event sources
- channel event sources
-
0.1.024 Aug 2018