Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

distributed-lock-manager

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distributed-lock-manager - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

4

package.json
{
"name": "distributed-lock-manager",
"version": "1.0.1",
"description": "A distributed lock manager (DLM) runs in every machine in a cluster, with an identical copy of a cluster-wide lock database.",
"version": "1.0.2",
"description": "The DLM maintains a list of system resources and provides locking mechanisms to control allocation and modification of resources.",
"main": "gulpfile.js",

@@ -6,0 +6,0 @@ "scripts": {

# Distributed Lock Manager
A distributed lock manager (DLM) runs in every machine in a cluster, with an identical copy of a cluster-wide lock database.
The DLM maintains a list of system resources and provides locking mechanisms to control allocation and modification of resources.

@@ -37,97 +37,6 @@ ## Installation

## HTTP Interface
## Client Libraries
### CSharp
* [DistributedLockManager.NET](https://www.nuget.org/packages/DistributedLockManager.NET)
```CSharp
var client = new RestClient();
client.BaseUrl = new Uri("http://localhost:5000");
var request = new RestRequest(Method.POST);
request.AddParameter("text/text", "acquire mylock\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
if (response.Content == "TRUE\r\n")
{
Console.WriteLine("Lock acquired");
}
else
{
Console.WriteLine("Failed to acquire lock");
}
```
### Node.js
```javascript
const rp = require('request-promise');
const response = await rp({
body: `acquire mylock\r\n`,
method: 'POST',
uri: 'http://localhost:5000',
});
if (response === 'TRUE\r\n') {
console.log('Lock acquired');
} else {
console.log('Failed to acquire lock');
}
```
## TCP Interface
### CSharp
```CSharp
var client = new TcpClient("127.0.0.1", 5001);
var stream = client.GetStream();
var messageSend = Encoding.ASCII.GetBytes("acquire mylock\r\n");
stream.Write(messageSend, 0, messageSend.Length);
byte[] bytesReceived = new byte[100];
int numberOfBytesReceived = stream.Read(bytesReceived, 0, 100);
var messageReceived = '';
for (int index = 0; index < numberOfBytesReceived; index++)
{
messageReceived += (char)bytesReceived[index];
}
if (messageReceived == "TRUE\r\n")
{
Console.WriteLine("Lock acquired");
} else
{
Console.WriteLine("Failed to acquire lock");
}
stream.Close();
client.Close();
```
### Node.js
```javascript
const net = require('net');
const client = new net.Socket();
client.connect(5001, '127.0.0.1', () => {
client.write(`acquire mylock\r\n`);
});
client.on('data', (data) => {
if (data.toString() === 'TRUE\r\n') {
console.log('Lock acquired');
} else {
console.log('Failed to acquire lock');
}
client.destroy();
});
```
## Performance

@@ -134,0 +43,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc