Class ServantService
- Namespace
- Dynamicweb.LoadBalancing.Service
- Assembly
- Dynamicweb.Core.dll
This service handles all internal command execution on the current node.
public sealed class ServantService
- Inheritance
-
ServantService
- Inherited Members
Properties
EnrollmentsAreInitialized
public bool EnrollmentsAreInitialized { get; }
Property Value
Methods
Drop(string)
Unregisters a function by name.
public bool Drop(string name)
Parameters
namestring
Returns
- bool
wasDropped
Enqueue(Command)
Enqueues a command.
public void Enqueue(Command command)
Parameters
commandCommandCommand to add
Enroll(string, Func<string, ApplicationResponse<string>>)
Registers a function that can be called later by using the name specified.
public bool Enroll(string name, Func<string, ApplicationResponse<string>> serviceAction)
Parameters
namestringName of function
serviceActionFunc<string, ApplicationResponse<string>>Function
Returns
- bool
wasEnrolled
InitializeEnrollments()
Initializes Enrollment instances. If enrollments are initialized, this method does nothing.
public void InitializeEnrollments()
InitializeEnrollments(bool)
Initializes Enrollment instances.
If enrollments are initialized, this method does nothing unless force is true.
public void InitializeEnrollments(bool force)
Parameters
forceboolSet to
trueto force reinitialization of enrollments.
IsEmpty()
Indicates if queue is empty.
public bool IsEmpty()
Returns
- bool
isEmpty
ProcessAll()
Processes all commands in the queue.
public IEnumerable<ApplicationResponse<string>> ProcessAll()
Returns
ProcessNext()
Processes the next command in the queue, if any exist, and returns a result.
public ApplicationResponse<string> ProcessNext()
Returns
- ApplicationResponse<string>
result