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

expose setTimer to python #463

Open
djdjoko opened this issue Feb 23, 2024 · 4 comments
Open

expose setTimer to python #463

djdjoko opened this issue Feb 23, 2024 · 4 comments

Comments

@djdjoko
Copy link

djdjoko commented Feb 23, 2024

Is it possible to expose the setTimer function to python? This would be a game changer for me and hopefully other python users :)

Thanks!

@cryptochassis
Copy link
Contributor

That is quite challenging if not entirely impossible because we generate the Python bindings through something called SWIG (https://www.swig.org/). setTimer requires a callback as parameter, and that feature isn't supported in SWIG. Could you elaborate a little bit more about your use case so that we can find a workaround? For example, you need a periodic timer to be triggered (every 1 second or on each exact second moment or ...)? Thank you.

@djdjoko
Copy link
Author

djdjoko commented Feb 23, 2024

Thanks for your reply! I would like ideally to have a periodic timer as you suggested but subscribing to multiple setTimer events would also work to mimic this behavior. Exact second is not that important but would also be a nice to have. Ideally I want some scheduling for low frequency operations.

@cryptochassis
Copy link
Contributor

We've found a workaround: not ideal at all, but can be used as a workaround. :) See: https://github.com/crypto-chassis/ccapi?tab=readme-ov-file#receive-subscription-events-at-periodic-intervals-including-when-the-market-depth-snapshot-hasnt-changed. That basically serves as a periodic "timer". Let me know if that works for your purpose or not. Meanwhile we continue to seek for a better solution. Thank you!

@djdjoko
Copy link
Author

djdjoko commented Mar 2, 2024 via email

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