I'm exploring an API surface for seemingly boilerplate-ish code, context cancellation and error handling. All pretty messy / not satisfactory so far, but going somewhere, I hope 🙃 Inspired by the API wrapper which came off quite nicely in p2panda.NodeBuilder.
Checklist
I/we have not used so-called 'AI' to create the proposed changes.
# Description
I'm exploring an API surface for seemingly boilerplate-ish code, context cancellation and error handling. All pretty messy / not satisfactory so far, but going somewhere, I hope 🙃 Inspired by the API wrapper which came off quite nicely in [`p2panda.NodeBuilder`](https://git.coopcloud.tech/decentral1se/p2panda-go/src/branch/main/nodebuilder/nodebuilder.go).
## Checklist
- [x] I/we have not used so-called 'AI' to create the proposed changes.
since this is following the "options" pattern, i think it's better here if you do endpointBuilder.ApplyMinimal. a later option can then set a more maximal preset. the reason is some situations i do not want to use N0's defaults. this is not just a preference for my own projects but important in other situations, like testing strictly local connectivity :)
since this is following the "options" pattern, i think it's better here if you do [`endpointBuilder.ApplyMinimal`](https://godocs.io/git.coopcloud.tech/decentral1se/iroh-go#EndpointBuilder.ApplyMinimal). a later option can then set a more maximal preset. the reason is some situations i do not want to use N0's defaults. this is not just a preference for my own projects but important in other situations, like testing strictly local connectivity :)
I think I'll have to leave this to the option API consumer as the options that get passed in are for constructing the endpoint, not running anything on top of it. I guess it gives more control since we don't really know what is coming back out of that function call 😆
I think I'll have to leave this to the option API consumer as the options that get passed in are for constructing the endpoint, not running anything on top of it. I guess it gives more control since we don't really know what is coming back out of that function call 😆
@decentral1se yuhhhh so excited to see this, and for it to build on your experiences w/ p2panda-go!! i left some comments based on my experience wrangling experiments :>
@decentral1se yuhhhh so excited to see this, and for it to build on your experiences w/ p2panda-go!! i left some comments based on my experience wrangling experiments :>
Still quite lost as how to cleanly stop streams / connections / endpoints 🤓
* https://docs.rs/iroh/latest/iroh/endpoint/struct.RecvStream.html
* https://docs.rs/iroh/latest/iroh/endpoint/struct.SendStream.html
* https://www.iroh.computer/blog/closing-a-quic-connection
Experiment ongoing 🙃
I've moved the current experiments into a separate example and will merge. I have a suspicion that the bindings don't support closing up streams/connections/endpoints cleanly and will reproduce some smaller examples shortlyupdate: see below. For now, I'm happy with the direction this is going in: a more high-level API which doesn't get in the way of low-level access.
I've moved the current experiments into a separate example and will merge. ~~I have a suspicion that the bindings don't support closing up streams/connections/endpoints cleanly and will reproduce some smaller examples shortly~~ **update**: see below. For now, I'm happy with the direction this is going in: a more high-level API which doesn't get in the way of low-level access.
I've moved the current experiments into a separate example and will merge. I have a suspicion that the bindings don't support closing up streams/connections/endpoints cleanly and will reproduce some smaller examples shortlyupdate: see below. For now, I'm happy with the direction this is going in: a more high-level API which doesn't get in the way of low-level access.
cool! I like that framing of your api exploration - higher level function calls that can coexist with more finely-grained / fussy approaches
it has been fun to poke my head in each time you force pushed "ah what change happened now?" ^__^
> I've moved the current experiments into a separate example and will merge. ~~I have a suspicion that the bindings don't support closing up streams/connections/endpoints cleanly and will reproduce some smaller examples shortly~~ **update**: see below. For now, I'm happy with the direction this is going in: a more high-level API which doesn't get in the way of low-level access.
cool! I like that framing of your api exploration - higher level function calls that can coexist with more finely-grained / fussy approaches
it has been fun to poke my head in each time you force pushed "ah what change happened now?" ^__^
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.
Description
I'm exploring an API surface for seemingly boilerplate-ish code, context cancellation and error handling. All pretty messy / not satisfactory so far, but going somewhere, I hope 🙃 Inspired by the API wrapper which came off quite nicely in
p2panda.NodeBuilder.Checklist
@@ -0,0 +10,4 @@var err errorendpointBuilder := iroh.NewEndpointBuilder()endpointBuilder.ApplyN0()since this is following the "options" pattern, i think it's better here if you do
endpointBuilder.ApplyMinimal. a later option can then set a more maximal preset. the reason is some situations i do not want to use N0's defaults. this is not just a preference for my own projects but important in other situations, like testing strictly local connectivity :)@@ -0,0 +16,4 @@if err := iroh.As(err); err != nil {return endpoint, err}endpoint.Online()beware beware, this
endpoint.Onlinebit can, depending on relay connectivity (I THINK) hang indefinitelysome more thinking, maybe the online wait could be an option?
I think I'll have to leave this to the option API consumer as the options that get passed in are for constructing the endpoint, not running anything on top of it. I guess it gives more control since we don't really know what is coming back out of that function call 😆
@decentral1se yuhhhh so excited to see this, and for it to build on your experiences w/ p2panda-go!! i left some comments based on my experience wrangling experiments :>
781a17afa1to2dd159a87c2dd159a87cto157b9699e6157b9699e6to4b020bd1124b020bd112toa31a00d4a8a31a00d4a8tob601ccc2ffb601ccc2ffto1afa4776a9504b9872e8toe123d83960e123d83960to36f241362736f2413627tobd011cd157bd011cd157to3fa75ca28c3fa75ca28ctoc3a4c52cfec3a4c52cfetoc1531e9d55c1531e9d55toe87922bb62Still quite lost as how to cleanly stop streams / connections / endpoints 🤓
Experiment ongoing 🙃
e87922bb62toa260f21903a260f21903to006c857766I've moved the current experiments into a separate example and will merge.
I have a suspicion that the bindings don't support closing up streams/connections/endpoints cleanly and will reproduce some smaller examples shortlyupdate: see below. For now, I'm happy with the direction this is going in: a more high-level API which doesn't get in the way of low-level access.Graceful Shutdown Works ™️
cool! I like that framing of your api exploration - higher level function calls that can coexist with more finely-grained / fussy approaches
it has been fun to poke my head in each time you force pushed "ah what change happened now?" ^__^