import { type IMPayload } from "https://deno.land/x/ddapps@1.6.5/messages.ts";
Interface used to type the payloads based on a Message type.
Type Parameters
extends IRequestPayload used to type the ClientRequest
extends IResponsePayload used to type the ClientResponse & ClientNotification
Properties
Message sent by DDAPPS to all components just after the server started. Use it an initialisation hook
Emitted during the network initialisation to indicate whether a peer to join has been found. The message is always emitted even if --discovery is disabled
A peer exposes the /discovery endpoint that returns the peer IP (legacy) This message is sent to Logger to indicate a peer has call the endpoint (the remote peer is thus in the discovery phase)
Message sent by clients to formulate requests It contains the operation to perform
Message sent to clients as a notification (client won't close connection on reception) It contains the operation that has been performed
Message sent to clients to respond to requests It contains the operation that has been performed
Indicates a Client has opened a connection to the server
A peer just opened a new connection
Indicates to a peer that its incoming connection has been accepted. It provides a list of other peers to connect to
Fetch a monitoring value (from state, or not, see the Monitor implementation)
Return a value from the state (or other source like Deno.metrics())
Get notified when a monitoring value changes. Monitor will send ClientNotification to notify the initiator
When a message destination is an IP or a Hostname, the Net will try to send it on the network This message is emitted if Net didn't find the corresponding Client or RemotePeer
Currently only used by Client but not emitted by server Indicates that the Client formulated an invalid ClientRequest