src/courier/PostMessageCourier.js
function _postMessage(args, name) {
                return this.circuit.run(function (success, failure, timeout) {
                    var message = _prepare.call(this, args, name, timeout);

                    if (message) {
                        try {
                            var initiated = this.messageChannel.postMessage.call(this.messageChannel, message);

                            if (false === initiated) {
                                failure();
                            }
                            else {
                                success();
                            }
                        }
                        catch (ex) {
                            failure();
                        }
                    }
                    else {
                        // Cache is full, as a fail fast mechanism, we should not continue
                        failure();
                    }
                }.bind(this));
            }
function _postMessage(args, name) {
                return this.circuit.run(function (success, failure, timeout) {
                    var message = _prepare.call(this, args, name, timeout);

                    if (message) {
                        try {
                            var initiated = this.messageChannel.postMessage.call(this.messageChannel, message);

                            if (false === initiated) {
                                failure();
                            }
                            else {
                                success();
                            }
                        }
                        catch (ex) {
                            failure();
                        }
                    }
                    else {
                        // Cache is full, as a fail fast mechanism, we should not continue
                        failure();
                    }
                }.bind(this));
            }
function _postMessage ( args , name ) { return this . circuit . run ( function ( success , failure , timeout ) { var message = _prepare . call ( this , args , name , timeout ) ; if ( message ) { try { var initiated = this . messageChannel . postMessage . call ( this . messageChannel , message ) ; if ( false === initiated ) { failure ( ) ; } else { success ( ) ; } } catch ( ex ) { failure ( ) ; } } else { // Cache is full, as a fail fast mechanism, we should not continue failure ( ) ; } } . bind ( this ) ) ; }
Method for posting the message via the circuit breaker
@param {Array} args - the arguments for the message to be processed.
@param {String} name - name of type of command.
@private
Method for posting the message via the circuit breaker