0.1.10 • Published 11 years ago

tusker v0.1.10

Weekly downloads
45
License
-
Repository
github
Last release
11 years ago

#Tusker - Redis Based Distributed Task Locking

##Why? Let's look at following scenario

  • We receive chunks of ogg's to encode into different servers
  • All of those are related to single stream
  • And we also receive the end of the stream too
  • Now we need to notify back, after all the chunks are encoded

##Do it with Tusker

###When we are encoding chunks

var tusker = require('tusker');
var taskManager = tusker.initialize();

//when we are begin to encode a chunk
var lockname = "" + Math.random();
taskManager.lock('the-task', lockname);

//after we do the encoding
taskManager.unlock('the-task', lockname);

###When we are closing the stream

var tusker = require('tusker');
var taskManager = tusker.initialize();

var info = { some_data: 10 };
taskManager.close('the-task', info);

###Receive notification after every chunk is encoded

taskManager.watchForReleased(function(err, taskName, info, watchAgain) {

//merge chunks and notify back
watchAgain();

});

0.1.10

11 years ago

0.1.9

11 years ago

0.1.8

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.0.1

11 years ago