events_streaming#

Module for events management.

Classes:

Event

alias of SolverEvent

EventsManager(event_type, ...)

Manages server-side events.

MeshingEvent(value[, names, module, ...])

Enumerates over supported server (Fluent) events.

SolverEvent(value[, names, module, ...])

Enumerates over supported server (Fluent) events.

ansys.fluent.core.streaming_services.events_streaming.Event#

alias of SolverEvent

class ansys.fluent.core.streaming_services.events_streaming.EventsManager(event_type, session_events_service, fluent_error_state, session)#

Bases: Generic[TEvent]

Manages server-side events.

This class allows the client to register and unregister callbacks with server events.

Methods:

__init__(event_type, session_events_service, ...)

__init__ method of EventsManager class.

register_callback(event_name, callback, ...)

Register the callback.

start(*args, **kwargs)

Start streaming.

stop()

Stop streaming.

unregister_callback(callback_id)

Unregister the callback.

__init__(event_type, session_events_service, fluent_error_state, session)#

__init__ method of EventsManager class.

register_callback(event_name, callback, *args, **kwargs)#

Register the callback.

Parameters:
event_nameTEvent or str

Event to register the callback to.

callbackCallable

Callback to register. If the custom arguments, args and kwargs, are empty then the callback signature must be precisely <function>(session, event_info). Otherwise, the arguments for args and/or kwargs must precede the other arguments in the signature.

argsAny

Arguments.

kwargsAny

Keyword arguments.

Returns:
str

Registered callback ID.

Raises:
InvalidArgument

If event name is not valid.

start(*args, **kwargs)#

Start streaming.

stop()#

Stop streaming.

unregister_callback(callback_id)#

Unregister the callback.

Parameters:
callback_idstr

ID of the registered callback.

class ansys.fluent.core.streaming_services.events_streaming.MeshingEvent(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Enumerates over supported server (Fluent) events.

Attributes:

ABOUT_TO_LOAD_CASE = 'AboutToReadCaseEvent'#
CASE_LOADED = 'CaseReadEvent'#
FATAL_ERROR = 'ErrorEvent'#
PROGRESS_UPDATED = 'ProgressEvent'#
SETTINGS_CLEARED = 'ClearSettingsDoneEvent'#
class ansys.fluent.core.streaming_services.events_streaming.SolverEvent(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#

Bases: Enum

Enumerates over supported server (Fluent) events.

Attributes:

ABOUT_TO_INITIALIZE_SOLUTION = 'AboutToInitializeEvent'#
ABOUT_TO_LOAD_CASE = 'AboutToReadCaseEvent'#
ABOUT_TO_LOAD_DATA = 'AboutToReadDataEvent'#
CALCULATIONS_ENDED = 'CalculationsEndedEvent'#
CALCULATIONS_PAUSED = 'CalculationsPausedEvent'#
CALCULATIONS_RESUMED = 'CalculationsResumedEvent'#
CALCULATIONS_STARTED = 'CalculationsStartedEvent'#
CASE_LOADED = 'CaseReadEvent'#
DATA_LOADED = 'DataReadEvent'#
FATAL_ERROR = 'ErrorEvent'#
ITERATION_ENDED = 'IterationEndedEvent'#
PROGRESS_UPDATED = 'ProgressEvent'#
REPORT_DEFINITION_UPDATED = 'ReportDefinitionChangedEvent'#
REPORT_PLOT_SET_UPDATED = 'PlotSetChangedEvent'#
RESIDUAL_PLOT_UPDATED = 'ResidualPlotChangedEvent'#
SETTINGS_CLEARED = 'ClearSettingsDoneEvent'#
SOLUTION_INITIALIZED = 'InitializedEvent'#
SOLUTION_PAUSED = 'AutoPauseEvent'#
SOLVER_TIME_ESTIMATE_UPDATED = 'SolverTimeEstimateEvent'#
TIMESTEP_ENDED = 'TimestepEndedEvent'#
TIMESTEP_STARTED = 'TimestepStartedEvent'#