Skip to main content

IStatelessServiceInstance

Trait IStatelessServiceInstance 

Source
pub trait IStatelessServiceInstance:
    Send
    + Sync
    + 'static {
    // Required methods
    fn open<'life0, 'async_trait>(
        &'life0 self,
        partition: Arc<dyn IStatelessServicePartition>,
        cancellation_token: BoxedCancelToken,
    ) -> Pin<Box<dyn Future<Output = Result<WString>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn close<'life0, 'async_trait>(
        &'life0 self,
        cancellation_token: BoxedCancelToken,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    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

fn open<'life0, 'async_trait>( &'life0 self, partition: Arc<dyn IStatelessServicePartition>, cancellation_token: BoxedCancelToken, ) -> Pin<Box<dyn Future<Output = Result<WString>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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

fn close<'life0, 'async_trait>( &'life0 self, cancellation_token: BoxedCancelToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

Implementors§