You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🚦`js-semaphore` is a simple **Semaphore** implementation using **Promises** for JavaScript aplications.
6
+
7
+
If you ever find a need for a syncronization mechanism usage into your application, you can use a Semaphore. If you want to use a Semaphore and you develop in JavaScript, you can use `js-semaphore`!
8
+
9
+
If your need is simple and a small mechanism with just **1 shared resource**, you can use `js-semaphore` as a **Mutex** too!
10
+
11
+
The source code comprehends the full **Semaphore** implementation with some basics tests and some applications. Actually, we have:
12
+
13
+
- 🤔🍜 Philosophers Dinner
14
+
15
+
#### Common questions
16
+
17
+
-_Why the tests take so long to complete?_
18
+
19
+
As this is a Semaphore implementation, the tests are based in time and waiting for a specific resource to continue the execution. We emulate this as a test in order to validate the correct behavior of the lib.
20
+
21
+
-_Why implement a Semaphore? Using Promises?_
22
+
23
+
As a common solver for deadlocks avoidance, we found an util lib to create and test! The Promises usage is just a matter of asynchronous need.
// remember to release the semaphore at the end of your usage
106
+
semaphore.release();
107
+
});
32
108
```
33
109
34
110
## Contributing
@@ -37,21 +113,21 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduc
37
113
38
114
## Changelog
39
115
40
-
This project adheres to [Semantic Versioning](https://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/codevor/js-library-boilerplate/releases) page.
116
+
This project adheres to [Semantic Versioning](https://semver.org/). Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/codevor/js-semaphore/releases) page.
41
117
42
118
## Bugs and Sugestions
43
119
44
-
Report bugs or do suggestions using the [issues](https://github.com/codevor/js-library-boilerplate/issues).
120
+
Report bugs or do suggestions using the [issues](https://github.com/codevor/js-semaphore/issues).
0 commit comments