How to use the @creditkarma/thrift-client.TcpConnection function in @creditkarma/thrift-client

To help you get started, we’ve selected a few @creditkarma/thrift-client 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 creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
return new Promise((resolve, reject) => {
                connection = new TcpConnection({
                    hostName: 'localhost',
                    port: PORT,
                })

                connection.register(
                    ThriftClientContextFilter({
                        RequestCodec: MetadataCodec,
                        ResponseCodec: MetadataCodec,
                    }),
                )

                client = new Calculator.Client(connection)

                mockServer = net.createServer((socket: net.Socket): void => {
                    console.log('TCP server created')
                    socket.addListener('data', (chunk: Buffer) => {
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
before(async () => {
            connection = new TcpConnection({
                hostName: 'localhost',
                port: 8888,
            })

            connection.register(
                {
                    handler(
                        request: IThriftRequest,
                        next: NextFunction,
                    ): Promise {
                        return next(request.data)
                    },
                },
                {
                    methods: ['echoString'],
                    handler(
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
before(async () => {
            connection = new TcpConnection({
                hostName: 'localhost',
                port: PORT,
            })

            connection.register(
                ThriftClientTTwitterFilter({
                    localServiceName: 'tcp-calculator-client',
                    remoteServiceName: 'calculator-service',
                    tracerConfig: {
                        endpoint: 'http://localhost:9411/api/v1/spans',
                        sampleRate: 1,
                        httpInterval: 0,
                    },
                }),
            )
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
before(async () => {
            connection = new TcpConnection({
                hostName: 'localhost',
                port: 8888,
            })

            client = new Calculator.Client(connection)
        })