How to use the @jenkins-cd/blueocean-core-js.sseService.registerHandler function in @jenkins-cd/blueocean-core-js

To help you get started, we’ve selected a few @jenkins-cd/blueocean-core-js 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 jenkinsci / blueocean-plugin / blueocean-pipeline-editor / src / main / js / SaveApi.js View on Github external
_registerSse(timeoutId, onComplete, onError) {
        const sseId = sseService.registerHandler(event => {
            if (event.job_multibranch_indexing_result === 'SUCCESS') {
                this._cleanup(sseId, timeoutId, onComplete, onError);
            }
            if (event.job_multibranch_indexing_result === 'FAILURE') {
                this._cleanup(sseId, timeoutId, onComplete, onError, { message: 'Indexing failed' });
            }
        });
    }
}
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / github / GithubFlowManager.js View on Github external
_initListeners() {
        this._cleanupListeners();

        LOGGER.debug('listening for org folder and multibranch indexing events...');

        this._sseSubscribeId = sseService.registerHandler(event => this._onSseEvent(event));
        this._sseTimeoutId = setTimeout(() => {
            this._onSseTimeout();
        }, SSE_TIMEOUT_DELAY);
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / git / GitFlowManager.jsx View on Github external
_initialize() {
        this._sseSubscribeId = sseService.registerHandler(event => this._onSseEvent(event));
        this.noCredentialsOption = {
            displayName: translate('creation.git.step1.credentials_placeholder'),
        };
    }
github jenkinsci / blueocean-plugin / blueocean-dashboard / src / main / js / creation / bitbucket / cloud / BbCloudFlowManager.js View on Github external
_initListeners() {
        this._cleanupListeners();

        LOGGER.debug('listening for org folder and multi-branch indexing events...');

        this._sseSubscribeId = sseService.registerHandler(event => this._onSseEvent(event));
        this._sseTimeoutId = setTimeout(() => {
            this._onSseTimeout();
        }, SSE_TIMEOUT_DELAY);
    }