技能 编程开发 WebSocket事件处理器抽象

WebSocket事件处理器抽象

v20260825
webiny-admin-websockets-catalog
这是一个通用的WebSocket事件处理器抽象,用于集中接收和处理所有传入的WebSocket消息。开发者无需直接订阅服务,而是注册处理器,通过过滤`event.payload.action`来精确响应自身关心的特定事件,极大提高了代码的健壮性和解耦性。
获取技能
351 次下载
概览

admin/websockets

How to Use

  1. Find the abstraction you need below
  2. You MUST read the source file to get the exact interface and types!
  3. Import: import { Name } from "<importPath>";

Abstractions


Name: WebsocketEventHandler Import: import { WebsocketEventHandler } from "webiny/admin/websockets" Source: @webiny/app-websockets/events/abstractions.ts Description: Handlers registered against this abstraction receive EVERY incoming websocket message (published as a WebsocketEvent by the websockets→EventPublisher bridge). Each handler is responsible for filtering by event.payload.action and reacting to the ones it cares about, instead of subscribing to the websocket service directly.


信息
Category 编程开发
Name webiny-admin-websockets-catalog
版本 v20260825
大小 843B
更新时间 2026-09-06
语言