This library allows for communication between the Virtubrick website and the Roblox Grid Service.
The Rcc\Job class is the first thing you should be constructing. All functions to interact with the Grid Service are called from here.
string $id(An RFC 4122 compliant Version 4 UUID will be substituted as the job ID if this is a blank string)int $expirationInSeconds(20)int $cores(0)int $category(0)
arbiter(Virtubrick\Grid\GridService): JobSets the arbiter that the Job will contact. Returns itself so these functions may be chained.script(Virtubrick\Grid\Rcc\LuaScript): JobSets the script that the Job opens with. Returns itself so these functions may be chained.batch(): arrayWill batch the Job. Returns results from the lua script.open(): arrayWill open the Job. Returns results from the lua script.execute(\Virtubrick\Grid\Rcc\LuaScript $input): arrayExecutes a script on the job. Returns result from the executed script.renewLease(int $expiration): arrayRenews the lease on the Job for $expiration amount of seconds.closeJob(): arrayCloses the job.closeAllJobs(): arrayCloses all present jobs.
Class that allows easy communication for scripts via the Job class.
string $namestring $scriptarray $arguments(Empty array by default)
This class describes your arbiter.
string $arbiter(ex. http://127.0.0.1:64989)
soapCall(string $name, ?array $args = null): arraySends a soap call to the Arbiter service. See RCCService.wsdl for details.
Generating a Thumbnail
use Virtubrick\Grid\GridService;
use Virtubrick\Grid\Rcc\{Job, LuaScript};
$job = (new Job($jobId = '', $expirationInSeconds = 120))
->arbiter(new GridService('http://127.0.0.1:64989'))
->script(new LuaScript(
$name = "RenderThumbnail {$key}",
$script = $script,
$arguments = $arguments
));
[$renderB64, $assetDependencies] = $job->batch();
header('x-asset-dependencies', implode(',', $assetDependencies));
exit(base64_decode($renderB64));Copyright 2024 kylegg