On 2021-01-05 David Emanuel da Costa Santiago <[email protected]>
wrote:
> > so the inner ``whenever`` really sets up a separate tap every time
> > it's executed.
> Is this behaviour expected? It kinda looks weird to me, specially
> when looking to the output...
Well, it's what *I* expected: a ``whenever`` sets up a tap (or a
"then", or a "receive"…), so if you run it multiple times, you get
multiple taps. And on a Supply, each tap receives a copy of each
emitted value, hence that output.
> > (If I change ``$outer`` to a Supplier/Supply pair… the program
> > hangs without printing anything, because there's a race between
> > the main process and the ``start``ed one, so all the
> > ``$outer.emit`` happen
> Don't you mean the $outer.send ?
``.send`` is for channels, ``.emit`` is for suppliers
> > before the ``react / whenever`` can tap, and ``$done-with-outer``
> > never gets kept. Using ``Supplier::Preserving`` fixes that)
>
> So IO::Socket::Async::SSL needs to use it, instead of a normal
> Supply?
No, the problem we saw with the socket were primarily what Liz
noticed, that we were deadlocking between ``await $conn.print`` and ``whenever
$conn.Supply``.
There *might* be a buffering issue somewhere too, but it's harder to
trigger, and not related to the use of a Supply, anyway.
--
Dakkar - <Mobilis in mobile>
GPG public key fingerprint = A071 E618 DD2C 5901 9574
6FE2 40EA 9883 7519 3F88
key id = 0x75193F88