WebSockets

Invoke @ws connected clients any function defined under the @app namespace.


Install runtime helpers for Node

cd path/to/lambda
npm init -f
npm install @architect/functions

Install runtime helpers for Ruby

cd path/to/lambda
bundle init
bundle install --path vendor/bundle
bundle add architect-functions

Install runtime helpers for Python

cd path/to/lambda
pip install --target ./vendor architect-functions

Publish JSON payload to a WebSocket client

Node

let arc = require('@achitect/functions')

await arc.ws.send({
  id: event.context.connectionId
  payload: {action: 'ping'},
})

Ruby

require 'architect/functions'

Arc::WS.send id: event.context.connectionId, payload: {action: 'ping'}

Python

import arc.ws

arc.ws.send(id=event.context.connectionId, payload={'action': 'ping'})