daily pastebin goal
75%
SHARE
TWEET

Untitled

a guest Jul 18th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //------------THRIFT FILE-----
  2. namespace php scheduler
  3.  
  4.  struct Job{
  5.    1: optional i32 id,
  6.    2: optional string type,
  7.    3: optional i32 increment,
  8.    4: optional string params,
  9.    5: optional string period,
  10.    6: optional string last_run,
  11.    7: optional string next_run
  12.  
  13.  }
  14.  
  15.  service JobExchange{
  16.    i32 insert_job(1: Job j),
  17.    Job get_job(1: i32 jid),
  18.    set<Job> get_all()
  19.  
  20.  }
  21.  
  22. //-----------------SERVER---------------------
  23. var thrift_server = thrift.createServer(scheduler_thrift,{
  24.    'get_all':function(success){
  25.        var job = new scheduler_ttypes.Job({'id':5,'type':'minute'});
  26.        var job2 = new scheduler_ttypes.Job({'id':10,'type':'hour'});
  27.        success([job,job2]);
  28.  
  29.    },
  30.    'get_job':function(jid,success){
  31.        console.log(jid,'GET JOB, JOB ID')
  32.        success(jid);
  33.    },
  34.    'insert_job':function(job,success){
  35.        console.log(sys.inspect(job),'INSERT JOB');
  36.        success(job);
  37.  
  38.    }
  39.  });
  40.   thrift_server.listen(8081);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top