hub.eb?material_id=425&track_id=431

Lock Manager


The lockManager interface provides in memory locking services via the following methods:

  • lock(), locks a specified resource id so that it can't be accessed by another user
  • unlock(), unlocks a resource id so that it can be accessed by another user

 

// check if a lock has been taken out
if(system.lockManager.lock("exam_answers", "exam_id")){
  // do something

  // unlock resource once finished
  system.lockManager.unlock("exam_answers", "exam_id"); 
}

Current Module

Related