一键导入
system-concurrency
Use when implementing inter-process locking or concurrency control in Zolinga modules. Covers the registry-based MySQL lock API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing inter-process locking or concurrency control in Zolinga modules. Covers the registry-based MySQL lock API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when creating or updating MCP resources — static files exposed to MCP clients via `resources/list` and `resources/read`. Covers `.meta.json` descriptors, URI rewriting, dynamic resources via `mcp:resources/list` event hook, and the `mcp-system` scheme.
Use when exposing an existing `origin: ["remote"]` listener as an MCP tool without rewriting the handler. Covers the one-line manifest pattern that re-uses the same class+method, plus the minimal schema work needed to satisfy `McpToolsListHandler::collectTools()`. Complements system-create-mcp-tool (which covers the greenfield case).
Use when exposing a Zolinga event handler as an MCP (Model Context Protocol) tool — i.e. a method clients can invoke via JSON-RPC `tools/call`. Covers handler class, manifest binding, JSON Schemas, the `Tools\CallEvent` contract, and the `schema.response` requirement enforced by `McpToolsListHandler::collectTools()`.
Use when working with the JavaScript client-side event system in Zolinga. Covers the Event class, Api gateway, dispatching events from JS to PHP, receiving broadcastBack responses, inter-component communication via BroadcastChannel, and web component integration.
Use when adding localized strings in PHP or HTML, including gettext usage patterns and context-aware translation strings for Zolinga Intl.
Use when writing or reviewing PHP code in this repository to enforce strict typing, naming, file layout, and listener/service interface conventions.
| name | system-concurrency |
| description | Use when implementing inter-process locking or concurrency control in Zolinga modules. Covers the registry-based MySQL lock API. |
| argument-hint | <module-name> <lock-name> |
Zolinga provides database-backed locking via the Registry service using MySQL GET_LOCK() / RELEASE_LOCK().
global $api;
if (!$api->registry->acquireLock('autoblog:generate', 0)) {
$event->setStatus(
CliRequestResponseEvent::STATUS_LOCKED,
"Already running."
);
return;
}
try {
// ... do work ...
} finally {
$api->registry->releaseLock('autoblog:generate');
}
acquireLock(string $name, int|string $timeout = 0): int|false
$timeout = 0 — fail immediately if lock is held.$timeout = 5 — wait up to 5 seconds.$timeout = "+1 minute" — wait up to 1 minute.false on failure.releaseLock(string $name): void
modules/zolinga-db/src/RegistryService.phpGET_LOCK() docs: https://mariadb.com/kb/en/get_lock/