-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilization #192
Comments
Poke @ids1024, I know this has been a problem upstream. |
Playing with calloop in conjunction with color-eyre, some of the errors being non Send sure to Rc(RefCell) was a little annoying, and makes me wonder if some of these places should instead use Arc(RwLock) instead. I haven't cut an issue about this yet (as I'm just getting familiar with calloop), but bring it up because that sounds like this sort of change would be a breaking change if things did want to implement thread safe errors (iirc, this problem affects registering a timer source). |
The goal of calloop is to be single threaded; multi-threaded code is explicitly not a goal. This should be written down somewhere. However all errors should be Send and Sync. I guess anyhow compatibility is a good reason for that. Is there a particular error that isn't? |
I'll create another issue for this instead of derailing this issue. |
Something that struck me as a little bit odd when getting up to speed with calloop was that the channel method returns a ( Just an observation on things which could be worth considering. |
I think it's because the "Sender" in I can understand that this is confusing, however. I'll think of a way to fix this while also emphasizing the importance of the underlying event source. |
Would RecieverSource be a reasonable name? This name would give a hint to the reader that it should be inserted into the event loop, that it will act generally like any other source, while keeping it obviously related to being the reciever side of the channel. The problem with calling this Channel is that a channel refers to the entire Sender-Receiver pair, not just one side of the pair, and this is really only the receiving side of things. |
I've found the name a bit odd, and |
Yes, I think it would be nice to change the name in this way. In fact, it would probably be more intuitive if everything that implemented |
Perhaps the other side of a source might be a -Handle (or perhaps -Signal)? Thinking a little more about ReceiverSource, even that name might be a little (linguistically) confusing as the two words kind of mean opposite things (i.e. a receiver accepts something and a source produces something). So I'd maybe come back to just calling this Receiver (and trusting that the uesrs of this library understand that it semantically does more than the receiver that it wraps. |
I'd like to stabilize
calloop
's public API to reduce breaking changes. This way when we release v1.0, we shouldn't have to release v2.0. Since we have no more public dependencies as of v0.14.0 this is now feasible.Potential semver hazards, just from glancing over
docs.rs
:calloop
is not compatible with the web. We also don't support WASI at the moment.calloop::Readiness
,calloop::Mode
,calloop::PostAction
andcalloop::Interest
could benon_exhaustive
. User code doesn't need to match on these.calloop::Readiness
'serror
field could be removed, since it's not emitted bypolling
.calloop::futures::ExecutorDestroyed
should be made non-instantiable by users.calloop::generic::FdWrapper
, since it can be replaced byBorrowedFd::borrow_raw
.pub
fields ofGeneric
not exposed, or only exposed via methods.calloop::io::{Readable, Writable}
returnResult<()>
instead of()
.calloop::ping::{Ping, PingSource}
a newtype wrapper instead of a type alias.calloop::signal::Singals
's method takeimpl IntoIterator<Item = impl Borrow<Signal>>
instead of&[Signal]
to increase compatibility.calloop::timer::Timer::current_deadline
?ForEventSource::Error
, what do we gain from it beingSync
? Especially since the rest ofcalloop
is usually thread-unsafe.RefCell::ref
inDispatcher
? It might be better to use closures here.EventLoop::try_new
should be renamed toEventLoop::new
. (Rename EventLoop::try_new to new #217)Other possible improvements:
LoopHandle
reference without cloning the loopRc
.The text was updated successfully, but these errors were encountered: