Using the with statement

You can create a thread and execute code within it using the with statement:

with client.thread() as thread:
    # do something

You can also continue a thread by passing the thread id to the thread method:


previous_thread_id = "UUID"

with client.thread(thread_id=previous_thread_id) as thread:
    # do something

Thread API

Thread API

Manipulate threads directly using the API.