BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/three/examples/jsm/utils
Run
Logout
Edit File
Size: 1.67 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/three/examples/jsm/utils/WorkerPool.js
Text
Base64
/** * @author Deepkolos / https://github.com/deepkolos */ export class WorkerPool { constructor( pool = 4 ) { this.pool = pool; this.queue = []; this.workers = []; this.workersResolve = []; this.workerStatus = 0; } _initWorker( workerId ) { if ( ! this.workers[ workerId ] ) { const worker = this.workerCreator(); worker.addEventListener( 'message', this._onMessage.bind( this, workerId ) ); this.workers[ workerId ] = worker; } } _getIdleWorker() { for ( let i = 0; i < this.pool; i ++ ) if ( ! ( this.workerStatus & ( 1 << i ) ) ) return i; return - 1; } _onMessage( workerId, msg ) { const resolve = this.workersResolve[ workerId ]; resolve && resolve( msg ); if ( this.queue.length ) { const { resolve, msg, transfer } = this.queue.shift(); this.workersResolve[ workerId ] = resolve; this.workers[ workerId ].postMessage( msg, transfer ); } else { this.workerStatus ^= 1 << workerId; } } setWorkerCreator( workerCreator ) { this.workerCreator = workerCreator; } setWorkerLimit( pool ) { this.pool = pool; } postMessage( msg, transfer ) { return new Promise( ( resolve ) => { const workerId = this._getIdleWorker(); if ( workerId !== - 1 ) { this._initWorker( workerId ); this.workerStatus |= 1 << workerId; this.workersResolve[ workerId ] = resolve; this.workers[ workerId ].postMessage( msg, transfer ); } else { this.queue.push( { resolve, msg, transfer } ); } } ); } dispose() { this.workers.forEach( ( worker ) => worker.terminate() ); this.workersResolve.length = 0; this.workers.length = 0; this.queue.length = 0; this.workerStatus = 0; } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 15
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
BufferGeometryUtils.js
31.03 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
CameraUtils.js
2.83 KB
lrw-r--r--
2025-03-28 11:04:37
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
GeometryCompressionUtils.js
12.24 KB
lrw-r--r--
2025-03-28 11:04:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
GeometryUtils.js
5.37 KB
lrw-r--r--
2025-03-28 11:04:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LDrawUtils.js
5.67 KB
lrw-r--r--
2025-03-28 11:04:38
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SceneOptimizer.js
8.46 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SceneUtils.js
6.45 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ShadowMapViewer.js
5.33 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ShadowMapViewerGPU.js
5.13 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SkeletonUtils.js
8.60 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SortUtils.js
3.04 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
UVsDebug.js
3.03 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WebGLTextureUtils.js
2.36 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WebGPUTextureUtils.js
1.53 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
WorkerPool.js
1.67 KB
lrw-r--r--
2025-03-28 11:04:39
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).