OverviewFilesCommitsIssuesDocsReleasesPeers

keet-cli / deobfuscated / lib / tasks / task.js

54 lines · javascript ref:
const _0x260ced=(function(){let _0x16ba29=!![];return function(_0x45195c,_0xf51d57){const _0x1ca817=_0x16ba29?function(){if(_0xf51d57){const _0x5f2da7=_0xf51d57.apply(_0x45195c,arguments);return _0xf51d57=null,_0x5f2da7;}}:function(){};return _0x16ba29=![],_0x1ca817;};}()),_0x3353a9=_0x260ced(this,function(){_0x15d688={_0x5c910e:0x2a9},_0x1bdfa3={_0x3f2b37:0x1e4};return _0x3353a9.toString().search("(((.+)+)+)+$").toString().constructor(_0x3353a9).search("(((.+)+)+)+$");});
_0x3353a9();
const ReadyResource=require('ready-resource');
const HypercoreId=require('hypercore-id-encoding');
class Task extends ReadyResource{
  constructor(_0x30bf05){
    _0x39b52b={
      _0x410cde:0x19},_0x1d9de8={
      _0x921e3e:0x2d4}
    ;
    super(),this.handle=_0x30bf05,this.description=_0x30bf05.description;
    this.type=this.description.type,this.scope=this.description.discoveryKey,this.priority=this.description.priority,this.keet=this.handle.manager.keet,this.store=this.keet.store;
    this.local=this.keet.local,this.swarm=this.keet.swarm,this.swarmWorker=this.keet.swarmWorker,this.files=this.keet.files,this._running=null;
  }
._open(){
  _0x5e9575={
    _0x1b34c3:0x17e,_0xe479bf:0xca},_0xf84ba9={
    _0x526be4:0x4f3,_0xc6bc3a:0xbe,_0x527528:0xc5}
  ;
  this._running=this._run(),this._running.catch(this.keet.onerror);
}
get.id(){
  _0x46fcb3={
    _0x3982be:0x3dc,_0x1da6c6:0x47,_0x26be7d:0xed},_0x4ad56d={
    _0x3baf9b:0x184,_0xf6f814:0x150}
  ;
  if(this._id)return this._id;
  return this._id=Task.getId(this.description),this._id;
}
async.run(){
  _0x2e2bdf={
    _0xaab14f:0x109,_0x41691e:0xfb},_0x3ac4fb={
    _0x2b2a31:0x16c,_0xdc032f:0x154,_0x1063b7:0xa0}
  ;
  if(!this.opened)await this.ready();
  await this._running;
  await this.close();
}
async._run(){
}
async._close(){
}
static.getId(_0x401977){
  _0x2651fc={
    _0x22b83f:0x52},_0x1ba0e1={
    _0x1fa550:0x372,_0x4e2f3b:0x64}
  ;
  return _0x401977.timestamp+':'+HypercoreId.encode(_0x401977.discoveryKey)+':'+_0x401977.type;
}
}
module.exports={
  'Task':Task}
;