upgrade function

Future<bool> upgrade(
  1. Event event,
  2. Hooks hooks
)

Upgrade request event to websocket.

Implementation

Future<bool> upgrade(Event event, Hooks hooks) async {
  final handle = event.get(#spry.ws.on_upgrade);
  if (handle is! UpgradeHandle) {
    return false;
  }

  return await handle(hooks);
}