IceGrid.Session¶
- class IceGrid.Session¶
-
Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created either via the
IceGrid.RegistryPrxobject or via the registry clientGlacier2.SessionManagerPrxobject.Notes
The Slice compiler generated this skeleton class from Slice interface
::IceGrid::Session.- abstractmethod allocateObjectById(id: Identity, current: Current) ObjectPrx | None | Awaitable[ObjectPrx | None]¶
Allocates an object.
- Parameters:
id (Identity) – The identity of the object to allocate.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
A proxy to the allocated object. This proxy is never null.
- Return type:
- Raises:
AllocationException – Thrown when the allocation fails.
ObjectNotRegisteredException – Thrown when an object with the given identity is not registered with the registry.
- abstractmethod allocateObjectByType(type: str, current: Current) ObjectPrx | None | Awaitable[ObjectPrx | None]¶
Allocates an object with the given type.
- Parameters:
type (str) – The type of the object.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
A proxy to the allocated object. This proxy is never null.
- Return type:
- Raises:
AllocationException – Thrown when the allocation fails.
- static ice_staticId() str¶
Obtain the type ID of the Slice interface.
- Returns:
The type ID.
- Return type:
- abstractmethod keepAlive(current: Current) None | Awaitable[None]¶
Keeps the session alive.
- Parameters:
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- abstractmethod releaseObject(id: Identity, current: Current) None | Awaitable[None]¶
Releases an object that was allocated using
IceGrid.SessionPrx.allocateObjectByIdAsync()orIceGrid.SessionPrx.allocateObjectByTypeAsync().- Parameters:
id (Identity) – The identity of the object to release.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]
- Raises:
AllocationException – Thrown when the object can’t be released. This can happen when the object is not allocatable or is not allocated by this session.
ObjectNotRegisteredException – Thrown when an object with the given identity is not registered with the registry.
- abstractmethod setAllocationTimeout(timeout: int, current: Current) None | Awaitable[None]¶
Sets the allocation timeout. When no object is immediately available for an allocation request, the implementation of
IceGrid.SessionPrx.allocateObjectByIdAsync()andIceGrid.SessionPrx.allocateObjectByTypeAsync()waits for the duration of thistimeout.- Parameters:
timeout (int) – The timeout in milliseconds.
current (Ice.Current) – The Current object for the dispatch.
- Returns:
None or an awaitable that completes when the dispatch completes.
- Return type:
None | Awaitable[None]