Top Description Methods
io.r2dbc.spi

public Interface Lifecycle

Imports
org.reactivestreams.Publisher

A common interface defining methods for allocation/release lifecycle control. The typical use case for this is to notify resources.

Can be implemented by connections. Components allocating/releasing connections notify resources implementing this interface about the ongoing activity so that resources can react in a proper way (e.g. allocating or releasing associated resources).

Since
0.9
See Also
Connection

Method Summary

Modifier and TypeMethod and Description
public Publisher<Void>

Returns:

a Publisher that indicates that the resource is ready for usage
postAllocate
()

Notifies the resource about its allocation.

public Publisher<Void>

Returns:

a Publisher that indicates that the resource is ready to be released
preRelease
()

Notifies the resource that it is about to be released.

Method Detail

postAllocateback to summary
public Publisher<Void> postAllocate()

Notifies the resource about its allocation. The method is called after creating a new resource or allocating a cached resource before applying any requests. The resource is ready for usage after completion of the returned Publisher.

Returns:Publisher<Void>

a Publisher that indicates that the resource is ready for usage

preReleaseback to summary
public Publisher<Void> preRelease()

Notifies the resource that it is about to be released. The method is called after finishing its usage and prior to its release/close. The resource is ready for being released after completion of the returned Publisher.

Returns:Publisher<Void>

a Publisher that indicates that the resource is ready to be released