Create a router that behaves like a Protocol.

  • Parameters

    • zone: Zone
    • powers: Powers
    • OptionalE: (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
          get: (<T>(x: T) => EGetters<LocalRecord<T>>);
          resolve: {
              (): Promise<void>;
              <T>(value: T): Promise<Awaited<T>>;
              <T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
          };
          sendOnly: (<T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>);
          when: (<T, U>(x: T | PromiseLike<T>, onfulfilled?: ((value: T) => ERef<U>), onrejected?: ((reason: any) => ERef<U>)) => Promise<U>);
      } = defaultE

      Eventual sender

    Returns ((...args: []) => Guarded<{
        bindPort(localAddr: string): Promise<Port | Vow<Port>>;
        registerProtocolHandler(paths: string[], protocolHandler: Remote<ProtocolHandler>): void;
        unregisterProtocolHandler(prefix: string, protocolHandler: Remote<ProtocolHandler>): void;
    }>)

      • (...args): Guarded<{
            bindPort(localAddr: string): Promise<Port | Vow<Port>>;
            registerProtocolHandler(paths: string[], protocolHandler: Remote<ProtocolHandler>): void;
            unregisterProtocolHandler(prefix: string, protocolHandler: Remote<ProtocolHandler>): void;
        }>
      • Parameters

        • Rest...args: []

        Returns Guarded<{
            bindPort(localAddr: string): Promise<Port | Vow<Port>>;
            registerProtocolHandler(paths: string[], protocolHandler: Remote<ProtocolHandler>): void;
            unregisterProtocolHandler(prefix: string, protocolHandler: Remote<ProtocolHandler>): void;
        }>