WebPubSubClient class
WebPubSub クライアント
コンストラクター
Web |
WebPubSubClient のインスタンスを作成する |
Web |
WebPubSubClient のインスタンスを作成する |
メソッド
コンストラクターの詳細
WebPubSubClient(string, WebPubSubClientOptions)
WebPubSubClient のインスタンスを作成する
new WebPubSubClient(clientAccessUrl: string, options?: WebPubSubClientOptions)
パラメーター
- clientAccessUrl
-
string
接続する URI
- options
- WebPubSubClientOptions
クライアント オプション
WebPubSubClient(WebPubSubClientCredential, WebPubSubClientOptions)
WebPubSubClient のインスタンスを作成する
new WebPubSubClient(credential: WebPubSubClientCredential, options?: WebPubSubClientOptions)
パラメーター
- credential
- WebPubSubClientCredential
接続時に使用する資格情報
- options
- WebPubSubClientOptions
クライアント オプション
メソッドの詳細
joinGroup(string, JoinGroupOptions)
クライアントをグループに参加させる
function joinGroup(groupName: string, options?: JoinGroupOptions): Promise<WebPubSubResult>
パラメーター
- groupName
-
string
グループ名
- options
- JoinGroupOptions
結合グループのオプション
戻り値
Promise<WebPubSubResult>
leaveGroup(string, LeaveGroupOptions)
クライアントをグループから離れる
function leaveGroup(groupName: string, options?: LeaveGroupOptions): Promise<WebPubSubResult>
パラメーター
- groupName
-
string
グループ名
- options
- LeaveGroupOptions
戻り値
Promise<WebPubSubResult>
off("connected", (e: OnConnectedArgs) => void)
接続されたイベントのハンドラーを削除する
function off(event: "connected", listener: (e: OnConnectedArgs) => void)
パラメーター
- event
-
"connected"
イベント名
- listener
-
(e: OnConnectedArgs) => void
ハンドラー
off("disconnected", (e: OnDisconnectedArgs) => void)
切断されたイベントのハンドラーを削除する
function off(event: "disconnected", listener: (e: OnDisconnectedArgs) => void)
パラメーター
- event
-
"disconnected"
イベント名
- listener
-
(e: OnDisconnectedArgs) => void
ハンドラー
off("group-message", (e: OnGroupDataMessageArgs) => void)
グループ メッセージのハンドラーを削除する
function off(event: "group-message", listener: (e: OnGroupDataMessageArgs) => void)
パラメーター
- event
-
"group-message"
イベント名
- listener
-
(e: OnGroupDataMessageArgs) => void
ハンドラー
off("rejoin-group-failed", (e: OnRejoinGroupFailedArgs) => void)
グループの再参加に失敗したハンドラーを削除しました
function off(event: "rejoin-group-failed", listener: (e: OnRejoinGroupFailedArgs) => void)
パラメーター
- event
-
"rejoin-group-failed"
イベント名
- listener
-
(e: OnRejoinGroupFailedArgs) => void
ハンドラー
off("server-message", (e: OnServerDataMessageArgs) => void)
サーバー メッセージのハンドラーを削除する
function off(event: "server-message", listener: (e: OnServerDataMessageArgs) => void)
パラメーター
- event
-
"server-message"
イベント名
- listener
-
(e: OnServerDataMessageArgs) => void
ハンドラー
off("stopped", (e: OnStoppedArgs) => void)
停止したイベントのハンドラーを削除する
function off(event: "stopped", listener: (e: OnStoppedArgs) => void)
パラメーター
- event
-
"stopped"
イベント名
- listener
-
(e: OnStoppedArgs) => void
ハンドラー
on("connected", (e: OnConnectedArgs) => void)
接続されたイベントのハンドラーを追加する
function on(event: "connected", listener: (e: OnConnectedArgs) => void)
パラメーター
- event
-
"connected"
イベント名
- listener
-
(e: OnConnectedArgs) => void
ハンドラー
on("disconnected", (e: OnDisconnectedArgs) => void)
切断されたイベントのハンドラーを追加する
function on(event: "disconnected", listener: (e: OnDisconnectedArgs) => void)
パラメーター
- event
-
"disconnected"
イベント名
- listener
-
(e: OnDisconnectedArgs) => void
ハンドラー
on("group-message", (e: OnGroupDataMessageArgs) => void)
グループ メッセージングのハンドラーを追加する
function on(event: "group-message", listener: (e: OnGroupDataMessageArgs) => void)
パラメーター
- event
-
"group-message"
イベント名
- listener
-
(e: OnGroupDataMessageArgs) => void
ハンドラー
on("rejoin-group-failed", (e: OnRejoinGroupFailedArgs) => void)
グループの再参加に失敗したハンドラーを追加しました
function on(event: "rejoin-group-failed", listener: (e: OnRejoinGroupFailedArgs) => void)
パラメーター
- event
-
"rejoin-group-failed"
イベント名
- listener
-
(e: OnRejoinGroupFailedArgs) => void
ハンドラー
on("server-message", (e: OnServerDataMessageArgs) => void)
サーバー メッセージのハンドラーを追加する
function on(event: "server-message", listener: (e: OnServerDataMessageArgs) => void)
パラメーター
- event
-
"server-message"
イベント名
- listener
-
(e: OnServerDataMessageArgs) => void
ハンドラー
on("stopped", (e: OnStoppedArgs) => void)
停止したイベントのハンドラーを追加する
function on(event: "stopped", listener: (e: OnStoppedArgs) => void)
パラメーター
- event
-
"stopped"
イベント名
- listener
-
(e: OnStoppedArgs) => void
ハンドラー
sendEvent(string, JSONTypes | ArrayBuffer, WebPubSubDataType, SendEventOptions)
カスタム イベントをサーバーに送信します。
function sendEvent(eventName: string, content: JSONTypes | ArrayBuffer, dataType: WebPubSubDataType, options?: SendEventOptions): Promise<WebPubSubResult>
パラメーター
- eventName
-
string
イベント名
- content
-
JSONTypes | ArrayBuffer
データの内容
- dataType
- WebPubSubDataType
データ型
- options
- SendEventOptions
選択肢
戻り値
Promise<WebPubSubResult>
sendToGroup(string, JSONTypes | ArrayBuffer, WebPubSubDataType, SendToGroupOptions)
グループにメッセージを送信します。
function sendToGroup(groupName: string, content: JSONTypes | ArrayBuffer, dataType: WebPubSubDataType, options?: SendToGroupOptions): Promise<WebPubSubResult>
パラメーター
- groupName
-
string
グループ名
- content
-
JSONTypes | ArrayBuffer
データの内容
- dataType
- WebPubSubDataType
データ型
- options
- SendToGroupOptions
選択肢
戻り値
Promise<WebPubSubResult>
start(StartOptions)
サービスの開始を開始します。
function start(options?: StartOptions): Promise<void>
パラメーター
- options
- StartOptions
戻り値
Promise<void>
stop()
クライアントを停止します。
function stop()