Options
All
  • Public
  • Public/Protected
  • All
Menu

Thrift Service Provider

class

ThriftProvider

Hierarchy

  • internal
    • ThriftProvider

Implements

  • IServiceProvider
  • IClientProvider

Index

Constructors

constructor

  • new ThriftProvider(thrift: IUniq<ThriftFile.IJSON>, respManager: IBaseResponseManager): ThriftProvider

Properties

clients

clients: IUniq<IClient>

Private headers

headers: IUniq<any>

Private respManager

respManager: IBaseResponseManager

Private thrift

thrift: IUniq<ThriftFile.IJSON>

Methods

add

  • Parse and add Thrift file

    Parameters

    • service: IThriftServiceJson
    • callback: function
        • (err: Error | null, server?: Server): void
        • Parameters

          • err: Error | null
          • Optional server: Server

          Returns void

    Returns void

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

create

createClient

  • Create Thrift client

    Parameters

    Returns function

      • (action: IClientAction, callback: function): void
      • Parameters

        • action: IClientAction
        • callback: function
            • (err: Error | null, action: IClientAction): void
            • Parameters

              • err: Error | null
              • action: IClientAction

              Returns void

        Returns void

delete

  • delete(id: string): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

Private emitRequest

  • emitRequest(serviceId: string, func: ThriftFile.IFunction, requestValue: any, data: any, exception?: undefined | string): void
  • Format and emit request

    Parameters

    • serviceId: string
    • func: ThriftFile.IFunction
    • requestValue: any
    • data: any
    • Optional exception: undefined | string

    Returns void

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

export

  • export(ids: string[]): object

find

  • find(id: string): IJSON

getMaxListeners

  • getMaxListeners(): number
  • Returns number

Private handler

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

Private missingResult

  • missingResult(func: ThriftFile.IFunction): object | object
  • Generate an error when response is expected, but not set

    Parameters

    • func: ThriftFile.IFunction

    Returns object | object

off

  • off(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

process

  • process(filePath: string, includes: string[], callback: function): void

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Object literals

Static protocols

protocols: object

Binary

Binary: TBinaryProtocol = TBinaryProtocol

Compact

Compact: TCompactProtocol = TCompactProtocol

Json

Json: TJSONProtocol = TJSONProtocol

Static transports

transports: object

Buffered

Buffered: TBufferedTransport = TBufferedTransport

Framed

Framed: TFramedTransport = TFramedTransport

Generated using TypeDoc