Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Lock.cs
1using System;
2using System.Collections.Generic;
3using System.Net;
4using System.Threading.Tasks;
5
7{
13 public class Lock : IClusterMessage
14 {
18 public string Resource
19 {
20 get;
21 set;
22 }
23
31 public Task<bool> MessageReceived(ClusterEndpoint Endpoint, IPEndPoint RemoteEndpoint)
32 {
33 lock (Endpoint.lockedResources)
34 {
35 return Task.FromResult<bool>(!Endpoint.lockedResources.ContainsKey(this.Resource));
36 }
37 }
38 }
39}
Represents one endpoint (or participant) in the network cluster.
Message used to inform other members that the sending endpoint is trying to lock a resource....
Definition: Lock.cs:14
string Resource
Resource to lock.
Definition: Lock.cs:19
Task< bool > MessageReceived(ClusterEndpoint Endpoint, IPEndPoint RemoteEndpoint)
Method called when the message has been received.
Definition: Lock.cs:31
Interface for cluster messages.