Skip to content
CheshireCaat edited this page Mar 9, 2020 · 10 revisions

Run functions with client

If you want to run the function, and you do not need to control the lifetime of the threads, use BasRemoteClient instance for this. In this case, the client itself creates and terminates BAS threads to perform functions.

The run_function() method returns an instance of the BasFunction class. Using it, you can stop the execution of a running function, get the ID of the thread in which it was run, or get the function result using method result().

The result() method can be used with await keyword. It will wait for the function to complete and return its result. If this method has been called repeatedly and the function has already completed, the same result will be returned.

Take a look at the examples:

Single function call

Clone this wiki locally