pub trait StatelessServiceInstance:
Send
+ Sync
+ 'static
+ Send {
// Required methods
fn open(
&self,
partition: &StatelessServicePartition,
cancellation_token: BoxedCancelToken,
) -> impl Future<Output = Result<WString>> + Send;
fn close(
&self,
cancellation_token: BoxedCancelToken,
) -> impl Future<Output = Result<()>> + Send;
fn abort(&self);
}
Expand description
Defines behavior that governs the lifecycle of a stateless service instance, such as startup, initialization, and shutdown.
Required Methods§
Sourcefn open(
&self,
partition: &StatelessServicePartition,
cancellation_token: BoxedCancelToken,
) -> impl Future<Output = Result<WString>> + Send
fn open( &self, partition: &StatelessServicePartition, cancellation_token: BoxedCancelToken, ) -> impl Future<Output = Result<WString>> + Send
Opens an initialized service instance so that it can be contacted by clients. Remarks: Opening an instance stateless service indicates that the service is now resolvable and discoverable by service clients. The string that is returned is the address of this service instance. The address is associated with the service name via Service Fabric naming and returned to clients that resolve the service via resolve_service_partition(uri).
Sourcefn close(
&self,
cancellation_token: BoxedCancelToken,
) -> impl Future<Output = Result<()>> + Send
fn close( &self, cancellation_token: BoxedCancelToken, ) -> impl Future<Output = Result<()>> + Send
Closes this service instance gracefully when the service instance is being shut down.
Sourcefn abort(&self)
fn abort(&self)
Terminates this instance ungracefully with this synchronous method call. Remarks: Examples of ungraceful termination are network issues resulting in Service Fabric process shutdown and the use of ReportFault(FaultType) to report a Permanent fault. When the service instance receives this method, it should immediately release and clean up all references and return.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.