emilbarton has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I've released the second version of my programs in perl6 for the Psybox, which is an RPi-Arduino device for parapsychological research.

https://github.com/emilbarton/psybox

I hope you'll enjoy it.

There's a problem that I can't correct : seems impossible to have two promises planned at the same time. One is an IO::Socket::Async. When run together with a background pin checker, the IO server requires to be triggered by hitting 'enter' on the readline. If anyone can help, I'll be delighted.

See: https://github.com/emilbarton/psybox/blob/master/RPi/perl6/psyboxctl.pl#L158.

Cf. Promise
  • Comment on Perl6: Can't plan two Promises simultaneously on Psybox

Replies are listed 'Best First'.
Re: Perl6: Can't plan two Promises simultaneously on Psybox
by stevieb (Canon) on Jun 03, 2016 at 13:59 UTC

    Hi emilbarton,

    Because this site has been primarily for Perl 5, many people here prefer it if we prefix our Perl 6 titles with "Perl6: ". Also, your title is not descriptive at all. A better title might be "Perl6: Can't plan two Promises simultaneously". I am going to consider this post for a title change (so if approved, the whole thread will be corrected). There are some Monks here who only work with Perl 6 now, and only look at Perl 6 related posts. Having accurate titles will get more P6 Monks looking at your question.

    Second, it would be appreciated if you could create a minimal, working example of your code that shows what's not working. Many people here will not follow links if the poster hasn't shown any code within their question. Put your code in <code></code> tags.

    One last thing... it would also help if you put a link to the Promise docs in your OP, like this: [https://docs.perl6.org/type/Promise|Promise], as many people who have interest on your thread are likely going to want to review the docs.

      Unfortunately I can't post a shortened version of the problem, as it seems related to the structure of the code. However, the problem appears rather on surface, at interface level and a quick look at line 158 and previous will make the question clear enough I hope.

        Fair enough. Thanks for updating your post though, that's much more descriptive. I'm just learning p6 at this time, but I like to go off on random tangents, so when I get some time today, I'll have a look... at minimum just to learn what the Promise class does.

Re: Perl6: Can't plan two Promises simultaneously on Psybox
by Anonymous Monk on Jun 03, 2016 at 13:08 UTC
    Relax, I am going to put the solution in your mind...