Well, solved the problem on my own after some hours of work and testing. Here's the solution I came up with:
app.js - Forking Cluster like you usually would do. However, in a child process of cluster, run a child process of the background.js
// FOrking and stuff
} else {
var background = child_process.fork(__dirname + '/background.js');
app.get('/', function(req, res) {
var job = {//job stuff here, like type of job and data and stuff};
background.send(job);
});
background.js - running as child process of a cluster worker
// Pretty much the same like before, but now queueing jobs and processing them too
process.on('message', function(object) {
jobs.create(//accessing your job data here like type of job priority and data);
});
Everything works as intended, but may not be the perfect solution. However, this makes clear how you can easily send messages between background job processes and app processes omitting the need to store the data between those two. Hope this will help somebody in the future.
So long.