src/loaders/support/LoaderWorkerSupport.js
function ( payload ) {
		if ( payload.cmd === 'run' ) {

			var self = this.getParentScope();
			var callbacks = {
				callbackOnAssetAvailable: function ( payload ) {
					self.postMessage( payload );
				},
				callbackOnProgress: function ( text ) {
					if ( payload.logging.enabled && payload.logging.debug ) console.debug( 'WorkerRunner: progress: ' + text );
				}
			};

			// Parser is expected to be named as such
			var parser = new Parser();
			if ( typeof parser[ 'setLogging' ] === 'function' ) parser.setLogging( payload.logging.enabled, payload.logging.debug );
			this.applyProperties( parser, payload.params );
			this.applyProperties( parser, payload.materials );
			this.applyProperties( parser, callbacks );
			parser.workerScope = self;
			parser.parse( payload.data.input, payload.data.options );

			if ( payload.logging.enabled ) console.log( 'WorkerRunner: Run complete!' );

			callbacks.callbackOnAssetAvailable( {
				cmd: 'complete',
				msg: 'WorkerRunner completed run.'
			} );

		} else {

			console.error( 'WorkerRunner: Received unknown command: ' + payload.cmd );

		}
	}
function ( payload ) {
		if ( payload.cmd === 'run' ) {

			var self = this.getParentScope();
			var callbacks = {
				callbackOnAssetAvailable: function ( payload ) {
					self.postMessage( payload );
				},
				callbackOnProgress: function ( text ) {
					if ( payload.logging.enabled && payload.logging.debug ) console.debug( 'WorkerRunner: progress: ' + text );
				}
			};

			// Parser is expected to be named as such
			var parser = new Parser();
			if ( typeof parser[ 'setLogging' ] === 'function' ) parser.setLogging( payload.logging.enabled, payload.logging.debug );
			this.applyProperties( parser, payload.params );
			this.applyProperties( parser, payload.materials );
			this.applyProperties( parser, callbacks );
			parser.workerScope = self;
			parser.parse( payload.data.input, payload.data.options );

			if ( payload.logging.enabled ) console.log( 'WorkerRunner: Run complete!' );

			callbacks.callbackOnAssetAvailable( {
				cmd: 'complete',
				msg: 'WorkerRunner completed run.'
			} );

		} else {

			console.error( 'WorkerRunner: Received unknown command: ' + payload.cmd );

		}
	}
function ( payload ) { if ( payload . cmd === 'run' ) { var self = this . getParentScope ( ) ; var callbacks = { callbackOnAssetAvailable : function ( payload ) { self . postMessage ( payload ) ; } , callbackOnProgress : function ( text ) { if ( payload . logging . enabled && payload . logging . debug ) console . debug ( 'WorkerRunner: progress: ' + text ) ; } } ; // Parser is expected to be named as such var parser = new Parser ( ) ; if ( typeof parser [ 'setLogging' ] === 'function' ) parser . setLogging ( payload . logging . enabled , payload . logging . debug ) ; this . applyProperties ( parser , payload . params ) ; this . applyProperties ( parser , payload . materials ) ; this . applyProperties ( parser , callbacks ) ; parser . workerScope = self ; parser . parse ( payload . data . input , payload . data . options ) ; if ( payload . logging . enabled ) console . log ( 'WorkerRunner: Run complete!' ) ; callbacks . callbackOnAssetAvailable ( { cmd : 'complete' , msg : 'WorkerRunner completed run.' } ) ; } else { console . error ( 'WorkerRunner: Received unknown command: ' + payload . cmd ) ; } }
Configures the Parser implementation according the supplied configuration object.

@param {Object} payload Raw mesh description (buffers, params, materials) used to build one to many meshes.
Configures the Parser implementation according the supplied configuration object .