Skip to content

GrainService Methods

Base class for implementing a grain-like partitioned service with per silo instances of it automatically instantiated and started by silo runtime

Init(IServiceProvider)

virtual
View source
public virtual Task Init(IServiceProvider serviceProvider)
Invoked upon initialization of the service

Parameters

serviceProviderIServiceProvider
The service provider.

Returns

A System.Threading.Tasks.Task representing the work performed.

OnRangeChange(IRingRange, IRingRange, bool)

virtual
View source
public virtual Task OnRangeChange(IRingRange oldRange, IRingRange newRange, bool increased)
Invoked when the ring range owned by the service instance changes because of a change in the cluster state

Parameters

oldRangeIRingRange
The old range.
newRangeIRingRange
The new range.
increasedbool
A value indicating whether the range has increased.

Returns

A System.Threading.Tasks.Task representing the work performed.

Start

virtual
View source
public virtual Task Start()
Invoked when service is being started

Returns

A System.Threading.Tasks.Task representing the work performed.

Stop

virtual
View source
public virtual Task Stop()
Invoked when service is being stopped

Returns

A System.Threading.Tasks.Task representing the work performed.