Skip to content

event_loop module #4985

@seanpearsonuk

Description

@seanpearsonuk

This module needs to be updated for Python 3.14. As it's not part of the core PyFluent business and unused internally, we should just remove it.

Below is an AI-suggested update if not removing, but this still feels wrong given the global scope of the side effect. It should just be removed.

def _get_loop():
    try:
        return asyncio.get_running_loop()
    except RuntimeError:
        loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)
        return loop

def execute_in_event_loop_threadsafe(f):
    def cb(*args, **kwargs):
        _get_loop().call_soon_threadsafe(partial(f, *args, **kwargs))
    return cb

def execute_in_event_loop(f):
    def cb(*args, **kwargs):
        _get_loop().call_soon(partial(f, *args, **kwargs))
    return cb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions