Guest User

Untitled

a guest
Jul 19th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var thrift = require('thrift');
  2. var sys = require('sys');
  3.  
  4. var scheduler_thrift = require('./gen-nodejs/JobExchange.js'),
  5. scheduler_ttypes = require('./gen-nodejs/scheduler_types.js');
  6.  
  7. var conn = thrift.createConnection('localhost', 8081),
  8. client = thrift.createClient(scheduler_thrift, conn);
  9.  
  10. conn.on('error', function(err) {
  11. console.error(err);
  12. conn.destroy();
  13. });
  14.  
  15. client.get_all(function(err, data) {
  16. console.log(err, data);
  17. conn.end();
  18. });
Add Comment
Please, Sign In to add comment