[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Implementing a cancelable task
From: |
dvn |
Subject: |
Re: Implementing a cancelable task |
Date: |
Thu, 23 Jul 2020 23:12:47 +0100 |
Hi Alessio,
Likely to get more helpful eyes on this if you send it to the "GNUnet
Developers" mailing list: <gnunet-developers@gnu.org>
Cheers,
Devan
Alessio Vanni transcribed 1.9K bytes:
> Hello,
>
> I have a service doing the following:
>
> * waits for a client to send a specific message
> * when the message arrives it opens a CADET channel
> * this channel is left open until the client requests it to be closed
> * the client sends another specific message
> * when the message arrives it is "unpacked" and sent over the channel
> * the remote peer replies with some data
> * when the data arrives it is "packed" and sent to the client
>
> I'd like to make the parts where the client waits for the service
> "cancelable tasks", i.e. have a "cancel" function that stops any further
> operations on the canceled message from being executed. Basically
> something like `GNUNET_SCHEDULER_cancel' or what the GNS service
> provides.
>
> I've peeked at the implementation of some of those functions, but there
> are few things troubling me (might be because I don't know how the code
> works, but still.)
>
> The first thing I saw was that those tasks use a unique ID embedded in
> the message. I tried something like that, but the CADET part doesn't
> make it practical, as I'd have to send the ID to the remote peer and
> hope that said peer doesn't change its value and/or use it for some
> nefarious purpose.
>
> Ultimately the problem is that I don't have a reliable way to associate
> a task with the execution of a certain callback.
>
> I was hoping someone could provide some help on the matter, especially
> since GNUnet has a lot of those cancelable tasks.
>
> Thank you,
> A.V.
>
> P.S. I tried subscribing to this list, but I can't tell if it succeeded
> or not. If it requires a mail confirmation, I didn't get anything after
> requesting the subscription. This is actually the second time I tried
> and still nothing. In this second attempt it might simply be a late
> delivery, but the first time I got nothing and I didn't receive anything
> of what was sent to the list afterwards. I can receive mails from other
> sources just fine (though it seems some places can't receive from me) so
> I really don't know what's going on.
>
signature.asc
Description: PGP signature