Switch to amphp/amp v3#24
Conversation
|
Please keep in mind that I'm still learning cooperative multitasking/AMP{2,3}/Revolt/Fibers and still finding basic examples to dispel numerous doubts (especially related to transition from v2 to v3). I started rehearsing with the Not sure if it's a good approach, but (instead of tests) I started from the demo executable ( Expect elementary mistakes. Here I still need a hard proof (a test) that all previously non-blocking operations remain so. Early feedback is also welcome, so I've released this change as a draft. |
|
Still unsure if (on watchers) we need to wrap An alternative is an external wrap - for example at the test (each case) level public function testSingleFileChange(): void
{
$process = $this->startProcess();
$this->delay();
$this->workspace()->put('foobar', '');
$this->delay();
async(function () use ($process): void {
self::assertEquals(
new ModifiedFile(
$this->workspace()->path('foobar'),
ModifiedFile::TYPE_FILE
),
$process->wait()
);
});
$process->stop();
}and (maybe accidentally) allows to satisfy the assertion and stop the process. |
|
Both in the For some reason that is still unclear, the test stopped displaying the unfinished loop message after increasing the delay between operations. @dantleech what do you think about the current state? |
No description provided.