How to use the @creditkarma/thrift-server-core.BufferedTransport function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-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 creditkarma / thrift-server / packages / thrift-integration / src / client / connections / HttpConnection.spec.ts View on Github external
(
                        req: http.IncomingMessage,
                        res: http.ServerResponse,
                    ): void => {
                        if (count < 1) {
                            count += 1
                            const upgradeResponse: TTwitter.IUpgradeReply = {}
                            const writer: thrift.TTransport = new thrift.BufferedTransport()
                            const output: thrift.TProtocol = new thrift.BinaryProtocol(
                                writer,
                            )
                            output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            TTwitter.UpgradeReplyCodec.encode(
                                upgradeResponse,
                                output,
                            )
                            output.writeMessageEnd()
                            res.writeHead(200)
                            res.end(writer.flush())
                        } else {
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            TTwitter.UpgradeReplyCodec.encode(
                                upgradeResponse,
                                output,
                            )
                            output.writeMessageEnd()
                            socket.write(frameCodec.encode(writer.flush()))
                        } else {
                            const responseHeader = new TTwitter.ResponseHeader(
                                {},
                            )
                            const writer: thrift.TTransport = new thrift.BufferedTransport()
                            const output: thrift.TProtocol = new thrift.BinaryProtocol(
                                writer,
                            )
                            output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            const result = new Calculator.Add__Result({
                                success: 61,
                            })
                            result.write(output)
                            output.writeMessageEnd()
                            const data: Buffer = writer.flush()

                            thrift