attach#
Enable and disable resilient mode on a live session.
Classes:
|
Resilient-mode controls of a session, available as |
Functions:
|
Disable resilient mode on |
|
Enable resilient mode on a live session. |
|
Return whether resilient mode is enabled on |
- class ansys.fluent.core.resilient.engine.attach.ResilientSession(controller)#
Bases:
objectResilient-mode controls of a session, available as
session.resilient.Methods:
__init__(controller)checkpoint(name)Write a checkpoint that
rollback()can restore.disable()Turn resilient mode off and exit the standby sessions.
on_event(listener)Call
listenerwith everyResilientEventof the session.redo()Re-apply the most recently undone settings value write.
rollback([name])Restore the newest checkpoint, or the newest one called
name.undo()Undo the most recent settings value write.
wait_for_standbys([timeout])Wait until the standby sessions applied every change made so far.
Attributes:
The session that currently serves settings calls.
The product adapter.
The retained checkpoints, oldest first.
The resilient-mode configuration.
Whether resilient mode is active on the session.
The journal of state-changing operations.
The outcome of the most recent intercepted write or command.
The warm standby pool, or
Nonewhen failover is not enabled.- __init__(controller)#
- property active_session: Any#
The session that currently serves settings calls.
This is the original session until a failover, and the standby session that took over afterwards.
- property adapter: ResilientAdapter#
The product adapter.
- checkpoint(name)#
Write a checkpoint that
rollback()can restore.- Parameters:
- name
str Name of the checkpoint.
- name
- Returns:
CheckpointThe written checkpoint.
- property checkpoints: list[Checkpoint]#
The retained checkpoints, oldest first.
- property config: ResilientConfig#
The resilient-mode configuration.
- disable()#
Turn resilient mode off and exit the standby sessions.
- property last_outcome: StepOutcome | None#
The outcome of the most recent intercepted write or command.
- on_event(listener)#
Call
listenerwith everyResilientEventof the session.- Parameters:
- listener
callable() Called with one
ResilientEventargument.
- listener
- property pool: WarmSessionPool | None#
The warm standby pool, or
Nonewhen failover is not enabled.
- redo()#
Re-apply the most recently undone settings value write.
- Returns:
SetOpThe redone operation.
- rollback(name=None)#
Restore the newest checkpoint, or the newest one called
name.Checkpoints written after it, and journal entries recorded after it, are discarded.
- Parameters:
- name
str,optional Name of the checkpoint to restore.
- name
- Returns:
CheckpointThe restored checkpoint.
- undo()#
Undo the most recent settings value write.
- Returns:
SetOpThe undone operation.
- wait_for_standbys(timeout=None)#
Wait until the standby sessions applied every change made so far.
Changes that succeed on the active session are applied to the standbys in the background. A failover already waits for them, so calling this is only needed to know that the standbys are up to date.
- ansys.fluent.core.resilient.engine.attach.disable_resilient_mode(session)#
Disable resilient mode on
session.Settings calls go directly to the product again and the standby sessions are exited. Calling this on a session without resilient mode does nothing.
- ansys.fluent.core.resilient.engine.attach.enable_resilient_mode(session, config=None, *, adapter, pool_size=None, standby_launcher=None, journal_complete=False)#
Enable resilient mode on a live session.
- Parameters:
- session
object A live product session with a settings tree.
- config
ResilientConfig,optional Resilient-mode configuration. The default configuration is used when omitted. The object is not modified.
- adapter
ResilientAdapter The product adapter.
- pool_size
int,optional Shortcut for
config.pool.size.- standby_launcher
callable(),optional Zero-argument callable that launches a standby session like
session. Product launch functions pass it; it is used only when the configuration does not say how to launch standbys.- journal_completebool,
optional Whether
sessionwas just launched, so that the journal records its whole history. Product launch functions passTrue.
- session
- Returns:
objectThe same session, with resilient controls available as
session.resilient.
- Raises:
ResilientErrorIf resilient mode is already enabled, the session has no settings service, or standby sessions cannot be launched.