// NOTE (2026-10-22): pretty sure program execution stops here if you can't
// get a connection to a relay (e.g. if you are rate-limited for too many tries)
e.Online()
I guess I should maybe check the Rust source first because this function returns nothing? There are a couple of these functions, so it might be good to develop a convention of <...>WithTimeout or something so I can wrap all the rest of them with a generic time out implementation?
Some interfaces such as conn.Closed() and endpoint.Online() should ideally expose a send/receive channel interface but instead work as a blocking call (where .await() is called internally).
Do we need to propose a default timeout internally also? 10 seconds?
Any API proposals in this regard @cblgh?
https://git.coopcloud.tech/cblgh/iroh-tracker/src/commit/51527839540f2d8e2726d744cb85fa4f781f0cf5/itcp/dialer.go#L157-L159
I guess I should maybe check the Rust source first because this function returns nothing? There are a couple of these functions, so it might be good to develop a convention of `<...>WithTimeout` or something so I can wrap all the rest of them with a generic time out implementation?
I noted this in https://git.coopcloud.tech/decentral1se/iroh-go#known-issues
> Some interfaces such as `conn.Closed()` and `endpoint.Online()` should ideally expose a send/receive channel interface but instead work as a blocking call (where `.await()` is called internally).
Do we need to propose a default timeout internally also? 10 seconds?
/// Resolves once the endpoint has a usable home relay.
#[napi]pubasyncfnonline(&self){self.inner.online().await;}
As for what to do, I don't really know. I think setting defaults for something like this has consequences if we choose the wrong value.
Your hunch to go for WithTimeout seems like it could be a good approach? All the Options right now are EndpointBuilder-focused though, so might make the endpoint/ internals messier ^^
From my pov, I feel like I would want something specific like WithWaitOnlineTimeout(t time.Time) and WithWaitOnline(), the latter being equivalent to calling endpoint.Online (i.e. potentially waiting forever) inside iroh.Endpoint.New() before returning the endpoint we built.
Here's `.online` from the [JS bindings of iroh-ffi](https://github.com/n0-computer/iroh-ffi/blob/main/iroh-js/src/endpoint.rs#L429-L434)
```rust
/// Resolves once the endpoint has a usable home relay.
#[napi]
pub async fn online(&self) {
self.inner.online().await;
}
```
---
As for what to do, I don't really know. I think setting defaults for something like this has consequences if we choose the wrong value.
Your hunch to go for `WithTimeout` seems like it could be a good approach? All the `Options` right now are `EndpointBuilder`-focused though, so might make the `endpoint/` internals messier ^^
From my pov, I feel like I would want something specific like `WithWaitOnlineTimeout(t time.Time)` and `WithWaitOnline()`, the latter being equivalent to calling `endpoint.Online` (i.e. potentially waiting forever) inside `iroh.Endpoint.New()` before returning the endpoint we built.
Which other ones have you come across? I've only ran into .Online acting up and don't know about any others
> @decentral1se There are a couple of these functions
Which other ones have you come across? I've only ran into `.Online` acting up and don't know about any others
Oh indeed, I was mistaken, the other calls I suspected do actually return something. That's good! This is much less impactful than I first thought then. I guess we can just leave it here until it becomes more annoying. I like the customisable API proposal.
Oh indeed, I was mistaken, the other calls I suspected do actually return something. That's good! This is much less impactful than I first thought then. I guess we can just leave it here until it becomes more annoying. I like the customisable API proposal.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Any API proposals in this regard @cblgh?
I guess I should maybe check the Rust source first because this function returns nothing? There are a couple of these functions, so it might be good to develop a convention of
<...>WithTimeoutor something so I can wrap all the rest of them with a generic time out implementation?I noted this in https://git.coopcloud.tech/decentral1se/iroh-go#known-issues
Do we need to propose a default timeout internally also? 10 seconds?
Here's
.onlinefrom the JS bindings of iroh-ffiAs for what to do, I don't really know. I think setting defaults for something like this has consequences if we choose the wrong value.
Your hunch to go for
WithTimeoutseems like it could be a good approach? All theOptionsright now areEndpointBuilder-focused though, so might make theendpoint/internals messier ^^From my pov, I feel like I would want something specific like
WithWaitOnlineTimeout(t time.Time)andWithWaitOnline(), the latter being equivalent to callingendpoint.Online(i.e. potentially waiting forever) insideiroh.Endpoint.New()before returning the endpoint we built.Which other ones have you come across? I've only ran into
.Onlineacting up and don't know about any othersOh indeed, I was mistaken, the other calls I suspected do actually return something. That's good! This is much less impactful than I first thought then. I guess we can just leave it here until it becomes more annoying. I like the customisable API proposal.
Related https://codeberg.org/cblgh/jasmine-teehaus/issues/1#issuecomment-27965245