Last active
February 29, 2020 17:56
-
-
Save jwulf/5c27cbcead60acabb07643296852869f to your computer and use it in GitHub Desktop.
A code sample from the article https://joshwulf.com/blog/2020/03/camunda-cloud-connection-2/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private handleGrpcError = (stream: any) => async (err: any) => { | |
| // this.emit('error', err) | |
| this.emit(MiddlewareSignals.Event.Error, err) | |
| // this.logger.error(`GRPC ERROR: ${err.message}`) | |
| this.emit(MiddlewareSignals.Log.Error, `GRPC ERROR: ${err.message}`) | |
| const channelState = await this.watchGrpcChannel() | |
| // this.logger.debug( | |
| // `gRPC Channel state: ${connectivityState[channelState]}` | |
| // ) | |
| this.emit( | |
| MiddlewareSignals.Log.Debug, | |
| `gRPC Channel state: ${connectivityState[channelState]}` | |
| ) | |
| stream.removeAllListeners() | |
| if ( | |
| channelState === GrpcState.READY || | |
| channelState === GrpcState.IDLE | |
| ) { | |
| // this.logger.info('gRPC Channel reconnected') | |
| this.emit(MiddlewareSignals.Log.Info, 'gRPC Channel reconnected') | |
| // this.emit('ready') | |
| this.emit(MiddlewareSignals.Event.Ready) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment