Spaces:
Sleeping
Sleeping
Download extensions/puterfs/fsentries/BaseOperation.js from AZILS/puter-deploy: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/spaces/AZILS/puter-deploy/resolve/main/extensions/puterfs/fsentries/BaseOperation.js
- Command line
-
hf download hf://spaces/AZILS/puter-deploy/extensions/puterfs/fsentries/BaseOperation.js
-
curl -L -o BaseOperation.js https://huggingface.co/spaces/AZILS/puter-deploy/resolve/main/extensions/puterfs/fsentries/BaseOperation.js
732 Bytes
| export default class BaseOperation { | |
| static STATUS_PENDING = {}; | |
| static STATUS_RUNNING = {}; | |
| static STATUS_DONE = {}; | |
| constructor () { | |
| this.status_ = this.constructor.STATUS_PENDING; | |
| this.donePromise = new Promise((resolve, reject) => { | |
| this.doneResolve = resolve; | |
| this.doneReject = reject; | |
| }); | |
| } | |
| get status () { | |
| return this.status_; | |
| } | |
| set status (status) { | |
| this.status_ = status; | |
| if ( status === this.constructor.STATUS_DONE ) { | |
| this.doneResolve(); | |
| } | |
| } | |
| awaitDone () { | |
| return this.donePromise; | |
| } | |
| onComplete (fn) { | |
| this.donePromise.then(fn); | |
| } | |
| } | |