File

src/streamingCalls/streamDescriptor.ts

Description

A descriptor for streaming calls.

Implements

Descriptor

Index

Properties
Methods

Constructor

constructor(streamType: StreamType)
Parameters :
Name Type Optional
streamType StreamType No

Properties

type
Type : StreamType

Methods

getApiCaller
getApiCaller(settings: CallSettings)
Parameters :
Name Type Optional
settings CallSettings No
Returns : APICaller
import {APICaller} from '../apiCaller';
import {Descriptor} from '../descriptor';
import {CallSettings} from '../gax';

import {StreamType} from './streaming';
import {StreamingApiCaller} from './streamingApiCaller';

/**
 * A descriptor for streaming calls.
 */
export class StreamDescriptor implements Descriptor {
  type: StreamType;

  constructor(streamType: StreamType) {
    this.type = streamType;
  }

  getApiCaller(settings: CallSettings): APICaller {
    // Right now retrying does not work with gRPC-streaming, because retryable
    // assumes an API call returns an event emitter while gRPC-streaming methods
    // return Stream.
    // TODO: support retrying.
    settings.retry = null;
    return new StreamingApiCaller(this);
  }
}

result-matching ""

    No results matching ""