Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take full advantage of asynchronous request execution #813

Closed
MariusWirtz opened this issue Oct 12, 2022 · 2 comments
Closed

Take full advantage of asynchronous request execution #813

MariusWirtz opened this issue Oct 12, 2022 · 2 comments
Milestone

Comments

@MariusWirtz
Copy link
Collaborator

There is currently no way to take full advantage of asynchronous request execution (asnyc_requests_mode).

It would be nice if TM1py could return the job-id to the calling function. This way python scripts could easily do stuff in parallel while polling the operations in TM1 to see if they are finished yet.

Reference:
https://gist.github.com/rclapp/2d6d8d389b99838d6e0fec18642e658f

@MariusWirtz MariusWirtz added this to the 2.0 milestone Oct 15, 2022
@MariusWirtz MariusWirtz pinned this issue Mar 16, 2023
@MariusWirtz
Copy link
Collaborator Author

Feature is implement for execute_process_with_return function with #1000 and #1035

This will be rolled out to other functions gradually over the next releases.

Example:

with TM1Service(**tm1params) as tm1:
    async_id = tm1.processes.execute_with_return(
        process_name="}bedrock.server.wait",
        pWaitSec=10,
        return_async_id=True)

    done = None
    while not done:
        time.sleep(1)
        done = tm1.processes.poll_execute_with_return(async_id)

    success, status, error_log_file = done
    print(success, status, error_log_file)

@MariusWirtz
Copy link
Collaborator Author

@rkvinoth, @ivankulman, @macsir
Beyond execute_with_return to which functions should we introduce the new parameter return_async_id?

@MariusWirtz MariusWirtz unpinned this issue Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant