Learn R Programming

ambiorix (version 2.2.0)

websocket_client: Websocket Client

Description

Handle ambiorix websocket client.

Usage

copy_websocket_client(path)

get_websocket_client_path()

get_websocket_clients()

Value

  • copy_websocket_client: String. The new path (invisibly).

  • get_websocket_client_path: String. The path to the local websocket client.

  • get_websocket_clients: List. Websocket clients.

Arguments

path

Path to copy the file to.

Functions

  • copy_websocket_client Copies the websocket client file, useful when ambiorix was not setup with the ambiorix generator.

  • get_websocket_client_path Retrieves the full path to the local websocket client.

  • get_websocket_clients Retrieves clients connected to the server.

Examples

Run this code
chat_ws <- function(msg, ws) {
  lapply(
    X = get_websocket_clients(),
    FUN = function(c) {
      c$send("chat", msg)
    }
  )
}

Run the code above in your browser using DataLab