samchon / tgrid

TypeScript RPC (Remote Procedure Call) for WebSocket and Worker protocols
https://tgrid.com/
MIT License
146 stars 19 forks source link

Refactor communicator classes to use abstract connector and acceptor #41

Closed samchon closed 4 years ago

samchon commented 4 years ago

Refactor all of the communicator classes in the TGrid to be derived from those abstract classes.

export abstract class ConnectorBase<Header, Provider extends object | null>
    extends Communicator<Provider>
{
    public constructor(header: Header, provider: Provider);
    public get header(): Header;
    public get state(): ConnectorBase.State;

    protected inspectReady(method: string): Error | null;
}

export abstract class AcceptorBase<Header, Provider extends object | null>
    extends Communicator<Provider>
{
    protected constructor(header: Header);
    public get header(): Header;
    public get state(): AcceptorBase.State;

    protected inspectReady(method: string): Error | null;
}