Skip to content

Worker::waitPayload virtually disables custom posix signal handling #1678

Answered by l-x
l-x asked this question in Q&A
Discussion options

You must be logged in to vote

To whom it may concern, we solved the issue with the following simple wrapper for the PHP StreamRelay:

<?php

declare(strict_types=1);

namespace Derp;

use Spiral\Goridge\Frame;
use Spiral\Goridge\RelayInterface;
use Spiral\Goridge\StreamRelay;

use function stream_select;

class StreamRelayWrapper implements RelayInterface
{
    /**
     * @param resource $readStream
     * @param StreamRelay $relay
     */
    public function __construct(
        private $readStream,
        private readonly StreamRelay $relay,
    ) {
    }

    private function waitForData(): void
    {
        $null = null;

        while (true) {
            $readStreams = [$this->readStream];
            
        …

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@rustatian
Comment options

@wolfy-j
Comment options

@l-x
Comment options

@l-x
Comment options

Answer selected by l-x
@rustatian
Comment options

@l-x
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
R-question Question
4 participants