[DGD] Chained continuations and curl

nikoroleva natasha.i.koroleva at gmail.com
Tue Sep 25 02:19:44 CEST 2018


Felix A. Croes <felix at dworkin.nl> wrote:
>
> nikoroleva <natasha.i.koroleva at gmail.com> wrote:
>
> > I was inspired by the thread on libraries for DGD/Hydra. I look
> > forward to more such posts.
>
> Your response provided impetus for some inspiration of my own.
>
> Continuations as implemented are not yet complete; I didn't go beyond
> the current implementation because I didn't have a use case for it
> yet.  Some thoughts:
>
>  - there is no way yet to start a new continuation that does not
>    delay the one currently running.  Something like
>
>     cont->runSeparate();
>
>  - there is no way to pause a continuation and wait for an external
>    signal to continue.  This could be used to handle user input, or
>    curl output, with a continuation
>  - there is no way to have a continuation with a non-zero delay yet
>
All good ideas.

> > I completed the first draft of a curl implementation.
>
> It looks like you implemented it as a kfun.  Why not in LPC?
>
Because of my ineptitude. I don't know anything about writing outbound
connections in the lib.

> >[...]
> > Thoughts about how best to do a curl implementation? How to write a
> > better JSON parser in DGD-LPC? How to make the most of the chained
> > continuations in this case?
>
> You could use a parse_string implementation for a partial JSON parsing
> + a left-over string of tokens that can only be parsed when more input
> is available.  This was previously discussed on the list in the context
> of parsing imud data.
>
I forgot about that discussion and I did not read it carefully. I will
give it another read this week.

> Must run; I will post more about this in the next few days.
>
Cool. Thanks.

Regards



More information about the DGD mailing list