Class MultiLock
Implements
Inherited Members
Namespace: k8s.LeaderElection.ResourceLock
Assembly: KubernetesClient.dll
Syntax
public class MultiLock : ILock
Constructors
View SourceMultiLock(ILock, ILock)
Declaration
public MultiLock(ILock primary, ILock secondary)
Parameters
| Type | Name | Description |
|---|---|---|
| ILock | primary | |
| ILock | secondary |
Properties
View SourceIdentity
the locks Identity
Declaration
public string Identity { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceCreateAsync(LeaderElectionRecord, CancellationToken)
Create attempts to create a LeaderElectionRecord
Declaration
public Task<bool> CreateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| LeaderElectionRecord | record | record to create |
| CancellationToken | cancellationToken | token to cancel the task |
Returns
| Type | Description |
|---|---|
| Task<bool> | true if created |
Describe()
Describe is used to convert details on current resource lock into a string
Declaration
public string Describe()
Returns
| Type | Description |
|---|---|
| string | resource lock description |
GetAsync(CancellationToken)
Get returns the LeaderElectionRecord
Declaration
public Task<LeaderElectionRecord> GetAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | token to cancel the task |
Returns
| Type | Description |
|---|---|
| Task<LeaderElectionRecord> | the record |
UpdateAsync(LeaderElectionRecord, CancellationToken)
Update will update and existing LeaderElectionRecord
Declaration
public Task<bool> UpdateAsync(LeaderElectionRecord record, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| LeaderElectionRecord | record | record to create |
| CancellationToken | cancellationToken | token to cancel the task |
Returns
| Type | Description |
|---|---|
| Task<bool> | true if updated |