- Use the
tracing
crate for logging instead of thelog
crate. (#195) - Make the
Generic
typeUnwindSafe
, even if its error is not. (#204)
- 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)
- Remove
nix
from the public API. This replacesSignal
with a home-grownSignal
enum andsiginfo
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)
- Improve the MSRV policy. Now, changes to the MSRV are no longer considered breaking changes, improving stability. (#189)
- Bump
nix
to v0.29. (#188)
- Bump
nix
tov0.28
. Asnix
is exposed in the public API, this is a breaking change. (#176)
- Fix a panic that would occur when a task is scheduled in an event callback. (#172)
calloop
is now supported for Windows. (#168)- Add the
signals
feature todocs.rs
. (#166)
- Fix a borrow error that can occur while using the executor. (#165)
Token
andRegistrationToken
are now invalidated when the event source they represent is removed from the event loop.- Implement
AsRawFd
andAsFd
forEventLoop<'l, Data>
- Fix an issue, where id-reuse could execute a PostAction on a newly registered event source
- Fix an issue where the
Generic
event source would try to unregister its contents from the event loop after a failed registration. - Fix an issue where the
EventLoop
would panic when processing aPostAction::Remove
from an event source with subsources.
- Fix
EventSource::before_handle_events()
being erroneously give an iterator over synthetic events instead of real events
- Bump MSRV to 1.63
- Make signals an optional feature under the
signals
features. - Replace the
nix
crate with standard library I/O errors and therustix
crate. pre_run
andpost_run
onEventSource
have been replaced withbefore_sleep
andbefore_handle_events
, respectively. These are now opt-in through theNEEDS_EXTRA_LIFECYCLE_EVENTS
associated constant, and occur at slightly different times to the methods they are replacing. This allows greater compatibility with Wayland based event sources.
- Fixed a crash due to double borrow when handling pre/post run hooks
- Fixes a panic that can occur when large
Duration
s are passed toTimer::from_duration
. - Replace the
sys
module with thepolling
crate.
- With the
block_on
feature enabled, theEventLoop
method now has ablock_on
method that runs a future to completion on the event loop.
- Bump MSRV to 1.56
- Breaking: The
TransientSource
is 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_deadline
returnsOption<Instant>
, so that it can returnNone
in the event of an overflow. - Breaking: Use
AsFd
instead ofAsRawFd
/RawFd
.
- The return value of
LoopHandle::insert_idle
no longer borrows theLoopHandle
.
- The
Channel
now has proxy methods forReceiver::recv
andReceiver::try_recv
- Enable support for
target_os = "android"
- Breaking: Calloop's internal storage is now backed by a
slotmap
. As a result theRegistrationToken
is nowCopy+Clone
, and the low-level registration API ofPoll
is altered in a breaking way. MSRV is bumped to 1.49. - Breaking:
generic::Fd
adapter is removed, as since that rust versionRawFd
implementsAsRawFd
, allowing it to be used directly inGeneric
. - Breaking: The
EventSource
trait 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
Error
type on theEventSource
trait. - Breaking: Many API functions now use Calloop's own error type (
calloop::Error
) instead ofstd::io::Error
as the error variants of their returned results. - Breaking: The
Timer
event 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 multipleTimer
s, 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
PingSource
event source now uses aneventfd
instead of a pipe on Linux.
- 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.
- Update
nix
dependency to 0.22
- MSRV is now 1.41
- The
futures
module 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
Token
creation 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 theToken
provided toprocess_events
is the same as the one you created when (re)registering your source. If you delegateprocess_events
to a sub-source, you no longer need to check thesub_id
before, instead the source you are delegating to is responsible to to this check.
- Cancelling a timeout no longer prevents later timeouts from firing.
- The
Dispatcher
type no longer has the closure type within its type parameters, but instead now has an explicit lifetime parameter, as well as the source typeS
and the event loopData
type. This allows the type to be explicitly named and stored into an other struct.
Token
now has a methodwith_sub_id()
that returns a copy of the token but with the givensub_id
.
EventLoop::run()
now acceptsInto<Option<Duration>>
, likeEventLoop::dispatch()
- The
Ping
event 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 ofExecutor
andChannel
, which usePing
internally.
- The return type for
LoopHandle::insert_source
was renamed asRegistrationToken
and can be used in{enable,disable,update,remove,kill}
just like before. - Allow non-
'static
event sources and callbacks, so they can hold references to other values.LoopHandle::with_source
was removed. To achieve the same behaviour, use aDispatcher
and register it via theLoopHandle::register_dispatcher
. TheEventSource
will be available usingDispatcher::as_source_{ref,mut}
.LoopHandle::remove
doesn't return the event source any more. To achieve the same behaviour, use aDispatcher
and register it via theLoopHandle::register_dispatcher
. After removing theEventSource
withLoopHandle::remove
, you will be able to callDispatcher::into_source_inner
to get ownership of theEventSource
.LoopHandle::register_dispatcher
can be used in place ofLoopHandle::insert_source
when the source needs to be accessed after its insertion in the loop.
Interest
is changed into a struct to allow empty interest queries
- Introduce a futures executor as a new event source, behind the
executor
cargo feature. - Introduce the
LoopHandle::adapt_io
method for creatingAsync<F>
adapters to adapt IO objects for async use, powered by the event loop.
- 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.
- Fix double borrow during dispatch when some event source is getting removed
- Add support for
openbsd
,netbsd
, anddragonfly
. InsertError<E>
now implementsstd::error::Error
.
- Allow non-
'static
dispatchData
.Data
is passed as an argument to thecallback
s while dispatching. This change allows definingData
types which can hold references to other values. dispatch
now will retry onEINTR
.
- Update the README and keywords for crates.io
- Introduce
LoopHandle::kill
to allow dropping a source from within its callback
- Drop the
mio
dependency - Breaking Change: Significantly rework the
calloop
API, 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
Ping
event source
channel::Channel
is nowSend
, allowing you to create a channel in one thread and sending its receiving end to an other thread for event loop insertion.
- Update
mio
to0.7
- Update to 2018 edition
- Update
nix
dependency to0.17
- Breaking Update
mio
dependency to0.7.0-alpha.1
. The API ofcalloop
for custom event sources significantly changed, and the channel and timer event sources are now implemented incalloop
rather than pulled frommio-extras
.
- Update
nix
dependency to0.14
- Update
mio
dependency - Update
nix
dependency
- Implement
Debug
forInsertError
.
- Disable the
sources::signal
module on FreeBSD so that the library can be built on this platform.
- Breaking Use
mio-extras
instead ofmio-more
which is not maintained. - Breaking Reexport
mio
rather than selectively re-exporting some of its types. - Add methods to
Generic
to retrive the innerRc
and construct it from anRc
- Breaking
LoopHandle::insert_source
now allows to retrieve the source on error.
- Fix the contents of
EventedRawFd
which was erroneously not public.
- introduce
EventedRawFd
as a special case for theGeneric
event 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
- Fixed a bug where inserting an event source from within a callback caused a panic.
- [breaking] Erase the
Data
type parameter fromSource
andIdle
, for improved ergonomics.
- Introduce an
EventLoop::run
method, as well as theLoopSignal
handle allowing to wakeup or stop the event loop from anywhere.
- Use
FnOnce
for insertion in idle callbacks.
- [breaking] Add a
&mut shared_data
argument toEventLoop::dispatch(..)
to share data between callbacks.
Generic
event source for wrapping arbitraryEvented
types- timer event sources
- UNIX signal event sources
- channel event sources
Initial release