-
Notifications
You must be signed in to change notification settings - Fork 5
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
async support for subscribed response.resolved() also dead links in the readme.md #43
Comments
Does this work for you? https://github.com/XRPL-Labs/xumm-sdk-py/blob/main/samples/payload.py |
Just to be clear you want the callback to be async as well? What exactly are you doing in the callback? Can you share your full code and what you're attempting to achieve? |
Having the awaiting And yes the code in the link you posted does work, but halts on the awaiting resolved() I did try putting the resolved() in its own asyncio thread etc, but that didn't work (as its other coroutines that hold the code up, payload.py it errors/reports at)... I can post code I have once home, in like 4+ hours... |
Ok if you can make a simple example that will help and I will fix it to do what you want. If you don't want it to await, then just remove the |
Tbh it's more or less as the link you posted ... I did want to keep it within the same function, (as its hard to reconnect to discord slash commands cleanly) |
Ahh I figured this is discord bot. |
there seems to be a few dead links ...
one of which im trying to find,
the Async process after returning data in the callback function
as im trying to find a async example of the on_payload_event/subscription_callback
only one i could find is this non async,
trying to convert this to async, seems to fail, as it returns anything which ends subscription
Also it says in docs
If a callback function is not provided, the subscription will stay active until the <PayloadSubscription>.resolve() method is called manually, eg. based on handling <PayloadSubscription>.websocket.onmessage events.
but it errors out if you try to use response.websocket.onmessage
(have also tried many others that are there after i dir() like _on_message, but is always None)
Additionally, in the docs it states;
Alternatively, the (by the sdk.payload_subscribe() method) returned raw websocket can be used to listen for WebSocket onmessage events.
and sdk.payload_subscribe() also doesn't seem to be a thing ? if thats a typo, still doesn't show the working onmessage endpoint.
The text was updated successfully, but these errors were encountered: