This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use React\Http\Server; | |
use React\Http\Response; | |
use React\EventLoop\Factory; | |
use Psr\Http\Message\ServerRequestInterface; | |
$loop = Factory::create(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function (ServerRequestInterface $request, \React\EventLoop\LoopInterface $loop) { | |
$childProcess = new \React\ChildProcess\Process('cat pages/index.html'); | |
$childProcess->start($loop); | |
return new React\Http\Response(200, ['Content-Type' => 'text/html'], $childProcess->stdout); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use React\EventLoop\Factory; | |
use React\Filesystem\Filesystem; | |
use function React\Promise\Stream\unwrapWritable; | |
require __DIR__ . '/../../vendor/autoload.php'; | |
$loop = Factory::create(); | |
$filesystem = Filesystem::create($loop); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const server = http.createServer((req, res) => { | |
res.statusCode = 200; | |
res.setHeader('Content-Type', 'text/plain'); | |
res.end('Hello world'); | |
}); | |
server.listen('8000', '127.0.0.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$workflowClient = WorkflowClient::create(ServiceClient::create($host)); | |
$workflow = $workflowClient->newUntypedWorkflowStub(MyWorkflow::class); | |
$workflowClient->start($workflow); | |
$describeWorkflowExecutionRequest = new DescribeWorkflowExecutionRequest(); | |
$describeWorkflowExecutionRequest->setNamespace('default'); | |
$describeWorkflowExecutionRequest->setExecution($workflow->getExecution()->toProtoWorkflowExecution()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
use Carbon\CarbonInterval; | |
use Temporal\Activity\ActivityOptions; | |
use Temporal\Common\RetryOptions; | |
use Temporal\Internal\Workflow\ActivityProxy; | |
use Temporal\Workflow; |