mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-13 03:21:02 +00:00
Add ping to the client, reconnect on dead connections
This commit is contained in:
@@ -29,6 +29,7 @@ export const Actions = {
|
||||
RemovedChain : 0x09 as 0x09,
|
||||
SubscribedTo : 0x0A as 0x0A,
|
||||
UnsubscribedFrom : 0x0B as 0x0B,
|
||||
Pong : 0x0C as 0x0C,
|
||||
};
|
||||
|
||||
export type Action = typeof Actions[keyof typeof Actions];
|
||||
@@ -98,6 +99,11 @@ export namespace Variants {
|
||||
action: typeof Actions.UnsubscribedFrom;
|
||||
payload: ChainLabel;
|
||||
}
|
||||
|
||||
export interface PongMessage extends MessageBase {
|
||||
action: typeof Actions.Pong;
|
||||
payload: string; // just echo whatever `ping` sent
|
||||
}
|
||||
}
|
||||
|
||||
export type Message =
|
||||
@@ -112,7 +118,8 @@ export type Message =
|
||||
| Variants.AddedChainMessage
|
||||
| Variants.RemovedChainMessage
|
||||
| Variants.SubscribedToMessage
|
||||
| Variants.UnsubscribedFromMessage;
|
||||
| Variants.UnsubscribedFromMessage
|
||||
| Variants.PongMessage;
|
||||
|
||||
/**
|
||||
* Opaque data type to be sent to the feed. Passing through
|
||||
|
||||
@@ -6,4 +6,5 @@ import * as FeedMessage from './feed';
|
||||
|
||||
export { Types, FeedMessage };
|
||||
|
||||
export const VERSION: Types.FeedVersion = 5 as Types.FeedVersion;
|
||||
// Increment this if breaking changes were made to types in `feed.ts`
|
||||
export const VERSION: Types.FeedVersion = 6 as Types.FeedVersion;
|
||||
|
||||
Reference in New Issue
Block a user