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

reusing context objects #182

Open
zihaolam opened this issue Nov 6, 2024 · 1 comment
Open

reusing context objects #182

zihaolam opened this issue Nov 6, 2024 · 1 comment

Comments

@zihaolam
Copy link

zihaolam commented Nov 6, 2024

Hi all,

I am planning to run futuapi in a server that long-living, isit recommended to reuse context objects such as OpenSecTradeContext?
or should we create a new object everytime we want to use the apis such as place_order()?

It seems that there are some setup overhead when instantiating the class and it seems that the OpenSecTradeContext will also hog up a port as mentioned in the docs.

@byblehua
Copy link
Collaborator

You can reuse context objects. As long as you don't call the trd_context.close() function, you can continue to use it. We also recommend doing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants