LocalStatelessServiceInstance

Trait LocalStatelessServiceInstance 

Source
pub trait LocalStatelessServiceInstance:
    Send
    + Sync
    + 'static {
    // Required methods
    async fn open(
        &self,
        partition: &StatelessServicePartition,
        cancellation_token: BoxedCancelToken,
    ) -> Result<WString>;
    async fn close(&self, cancellation_token: BoxedCancelToken) -> Result<()>;
    fn abort(&self);
}
Expand description

Defines behavior that governs the lifecycle of a stateless service instance, such as startup, initialization, and shutdown.

Required Methods§

Source

async fn open( &self, partition: &StatelessServicePartition, cancellation_token: BoxedCancelToken, ) -> Result<WString>

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).

Source

async fn close(&self, cancellation_token: BoxedCancelToken) -> Result<()>

Closes this service instance gracefully when the service instance is being shut down.

Source

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.

Implementors§

Source§

impl<TraitVariantBlanketType: StatelessServiceInstance> LocalStatelessServiceInstance for TraitVariantBlanketType