How to use the rsocket-core/build/RSocketClient function in rsocket-core

To help you get started, we’ve selected a few rsocket-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scalecube / scalecube-js / packages / scalecube-microservice / src / TransportProviders / MicroserviceClient.ts View on Github external
const createClient = ({
  address,
  transportClientProvider,
}: {
  address: Address;
  transportClientProvider: TransportApi.Provider;
}) => {
  const { factoryOptions, providerFactory, serializers, setup } = transportClientProvider;

  return new RSocketClient({
    serializers,
    setup: {
      dataMimeType: (setup && setup.dataMimeType) || 'text/plain',
      keepAlive: (setup && setup.keepAlive) || 1000000,
      lifetime: (setup && setup.lifetime) || 1000000,
      metadataMimeType: (setup && setup.metadataMimeType) || 'text/plain',
    },
    transport: providerFactory({ address, factoryOptions }),
  });
};