//include the class source
//instantiate a new object
$b = new background;
//check the users connection status,
//only needs to be done once, then it becomes internal
$status = $b->isUserConn();
//keep the user connection alive, even if browser is closed!
$callback = $b->keepAlive();
//this is where you would call your code that takes a long time to execute
sleep(60); //fake the long process - a 60 second process
//fork the process, and create the child process
//call the callback function when done!
$call2 = $b->setCallback("firstname.lastname@example.org","Your Script","The really long running process that you requested is complete!");