定制 virtubrick/grid 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

virtubrick/grid

最新稳定版本:v1.0.1

Composer 安装命令:

composer require virtubrick/grid

包简介

Helper library for communicating with the Roblox Grid Service.

README 文档

README

This library allows for communication between the Virtubrick website and the Roblox Grid Service.

Virtubrick\Grid\Rcc\Job

The Rcc\Job class is the first thing you should be constructing. All functions to interact with the Grid Service are called from here.

Constructor

  • 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)

Methods

  • arbiter(Virtubrick\Grid\GridService): Job Sets the arbiter that the Job will contact. Returns itself so these functions may be chained.
  • script(Virtubrick\Grid\Rcc\LuaScript): Job Sets the script that the Job opens with. Returns itself so these functions may be chained.
  • batch(): array Will batch the Job. Returns results from the lua script.
  • open(): array Will open the Job. Returns results from the lua script.
  • execute(\Virtubrick\Grid\Rcc\LuaScript $input): array Executes a script on the job. Returns result from the executed script.
  • renewLease(int $expiration): array Renews the lease on the Job for $expiration amount of seconds.
  • closeJob(): array Closes the job.
  • closeAllJobs(): array Closes all present jobs.

Virtubrick\Grid\Rcc\LuaScript

Class that allows easy communication for scripts via the Job class.

Constructor

  • string $name
  • string $script
  • array $arguments (Empty array by default)

Virtubrick\Grid\GridService

This class describes your arbiter.

Constructor

Methods

  • soapCall(string $name, ?array $args = null): array Sends a soap call to the Arbiter service. See RCCService.wsdl for details.

Example Usage:

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

统计信息

  • 总下载量: 39
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2024-03-04