encoderTranslationDidFinish (
    encoder, isEncode, result, usedSource, usedSettingsVersion) {
    // check if encoder is still part of the pipe
    if (!this.containsBrick(encoder)) {
      // result is no longer relevant
      // do nothing
      return
    }

    // mark brick as no longer busy
    this.setBrickMeta(encoder, 'busy', false)

    if (result === false) {
      // TODO handle translation error
      return
    }

    let settingsVersion = this.getBrickMeta(encoder, 'settingsVersion')
    let lowerBucket = this.getBucketIndexForBrick(encoder)
    let sourceBucket = isEncode ? lowerBucket : lowerBucket + 1
    let resultBucket = isEncode ? lowerBucket + 1 : lowerBucket

    // propagate result
    this.setContent(resultBucket, result, encoder)

    // there were translations skipped when the current source content or brick
    //  settings changed during last translation
    if (!this.getContent(sourceBucket).isEqualTo(usedSource) ||
        settingsVersion !== usedSettingsVersion) {
      // repeat translation
      this.triggerEncoderTranslation(encoder, isEncode)
    }
  }
/**
   * Triggered when a result comes back from the encoder. Propagates result and
   * triggers new translation when the source content has changed during
   * previous translation.
   * @protected
   * @param {Encoder} encoder
   * @param {boolean} isEncode True for encoding, false for decoding.
   * @param {Chain|boolean} result Result chain or false, if failed
   * @param {Chain} usedSource
   * @param {number} usedSettingsVersion
   */
Triggered when a result comes back from the encoder. Propagates result and
triggers new translation when the source content has changed during
previous translation.
@protected
@param {Encoder} encoder
@param {boolean} isEncode True for encoding, false for decoding.
@param {Chain|boolean} result Result chain or false, if failed
@param {Chain} usedSource
@param {number} usedSettingsVersion
Triggered when a result comes back from the encoder . Propagates result and triggers new translation when the source content has changed during previous translation . @protected @param { Encoder } encoder @param { boolean } isEncode True for encoding false for decoding . @param { Chain|boolean } result Result chain or false if failed @param { Chain } usedSource @param { number } usedSettingsVersion
encoderTranslationDidFinish (
    encoder, isEncode, result, usedSource, usedSettingsVersion) {
    if (!this.containsBrick(encoder)) {
      return
    }
    this.setBrickMeta(encoder, 'busy', false)
    if (result === false) {
      return
    }
    let settingsVersion = this.getBrickMeta(encoder, 'settingsVersion')
    let lowerBucket = this.getBucketIndexForBrick(encoder)
    let sourceBucket = isEncode ? lowerBucket : lowerBucket + 1
    let resultBucket = isEncode ? lowerBucket + 1 : lowerBucket
    this.setContent(resultBucket, result, encoder)
    if (!this.getContent(sourceBucket).isEqualTo(usedSource) ||
        settingsVersion !== usedSettingsVersion) {
      this.triggerEncoderTranslation(encoder, isEncode)
    }
  }
encoderTranslationDidFinish ( encoder , isEncode , result , usedSource , usedSettingsVersion ) { if ( ! this . containsBrick ( encoder ) ) { return } this . setBrickMeta ( encoder , 'busy' , false ) if ( result === false ) { return } let settingsVersion = this . getBrickMeta ( encoder , 'settingsVersion' ) let lowerBucket = this . getBucketIndexForBrick ( encoder ) let sourceBucket = isEncode ? lowerBucket : lowerBucket + 1 let resultBucket = isEncode ? lowerBucket + 1 : lowerBucket this . setContent ( resultBucket , result , encoder ) if ( ! this . getContent ( sourceBucket ) . isEqualTo ( usedSource ) || settingsVersion !== usedSettingsVersion ) { this . triggerEncoderTranslation ( encoder , isEncode ) } }
Triggered when a result comes back from the encoder.
Triggered when a result comes back from the encoder .
// check if encoder is still part of the pipe // result is no longer relevant // do nothing // mark brick as no longer busy // TODO handle translation error // propagate result // there were translations skipped when the current source content or brick //  settings changed during last translation // repeat translation