init(of:metadata:producer:)

Creates a new accepted response.

ServerResponse.swift:298
init(of messageType: Message.Type = Message.self, metadata: Metadata = [:], producer: @escaping (RPCWriter<Message>) async throws -> Metadata)

Parameters

messageType

The type of message.

metadata

Metadata to send to the client at the beginning of the response.

producer

A closure which, when called, writes messages to the client.