Closed rmja closed 1 year ago
Async is a protected keyword in rust, so the Convention is to use asynch
Hi @rmja I've pulled in your changes into my fork (https://github.com/mvniekerk/atat/)
The safe buffer size guard seems not to be working. Would've been cool if it did though.
In essence, I've done this:
const INGRESS_BUF_SIZE: usize = RX_SIZE;
const RES_CAPACITY: usize = 2 * (INGRESS_BUF_SIZE + 3) + 1;
Which means the code on /atat/src/buffers.rs
pub const fn is_valid_res_capacity<const INGRESS_BUF_SIZE: usize, const RES_CAPACITY: usize>(
) -> bool {
RES_CAPACITY >= 2 * (BBQUEUE_FRAME_HEADER_SIZE + RES_FRAME_DISPATCH_SIZE + INGRESS_BUF_SIZE)
}
Should've evaluated as true (it doesn't). Unless I'm missing something?
@mvniekerk
It turns out that the issue has to do with the way the new is called:
static buffers_work: Buffers<Urc, 500, 1010, 10, 1> =
Buffers::<Urc, 500, 1010, 10, 1>::new();
static buffers_does_not_work: Buffers<Urc, 500, 1010, 10, 1> =
Buffers::new();
Apparently one needs to be explicit about the turbofish when calling new.
Seems like a compiler error then...
Groete / Best regards Michael van Niekerk
Van: Rasmus Melchior Jacobsen @.> Gestuur: Monday, March 20, 2023 9:58:56 AM aan: BlackbirdHQ/atat @.> Aa: Michael van Niekerk @.>; Mention @.> onderwerp: Re: [BlackbirdHQ/atat] Async client (PR #142)
@mvniekerkhttps://github.com/mvniekerk
It turns out that the issue has to do with the way the new is called:
static buffers_work: Buffers<Urc, 500, 1010, 10, 1> =
Buffers::<Urc, 500, 1010, 10, 1>::new();
static buffers_does_not_work: Buffers<Urc, 500, 1010, 10, 1> =
Buffers::new();
Apparently one needs to be explicit about the turbofish when calling new.
— Reply to this email directly, view it on GitHubhttps://github.com/BlackbirdHQ/atat/pull/142#issuecomment-1475770931, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAL7O7YV4NZTOFQ6L7NTFXDW5AE4BANCNFSM6AAAAAAVB5YF6E. You are receiving this because you were mentioned.Message ID: @.***>
Either that, or you need to define #![feature(generic_const_exprs)]
in main.rs
. If you do that, then the second one will also work.
I've tested adding the params, it worked. Thanks @rmja
@rmja Ready to merge this, so we can add a followup PR with the pubsub URC handling, and code-size optimizations?
Really nice. Yes!
Will you rebase, and open the followup PR? :)
This PR adds an async atat client. It incurs some major changes to the current project structure, so it should be merged with care.
There are some outstanding issues: