Skip to content
Browse files

tricky lazy LockQueueManager function loading for type checking

  • Loading branch information...
1 parent aa4e699 commit 36028eb2633d7509e7884aaed6823402a74dccf1 @bobrik committed
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Lock.js
View
8 lib/Lock.js
@@ -1,5 +1,13 @@
(function(module) {
+ function getLockQueueManagerFunction() {
+ return require("./LockQueueManager");
+ }
+
function Lock(name, manager) {
+ if (!(manager instanceof getLockQueueManagerFunction())) {
+ throw new Error("Invalid queue manager provided");
+ }
+
this.name = name;
this.acquired = false;
this.manager = manager;

0 comments on commit 36028eb

Please sign in to comment.
Something went wrong with that request. Please try again.