-
Notifications
You must be signed in to change notification settings - Fork 18
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
Long polling #541
Long polling #541
Conversation
…-polling # Conflicts: # yajsapi/market/demand.ts
…-polling # Conflicts: # yajsapi/payment/payments.ts
@@ -61,7 +62,10 @@ export class PaymentApiMock extends RequestorApi { | |||
appSessionId?: string, | |||
options?: AxiosRequestConfig, | |||
): Promise<import("axios").AxiosResponse<InvoiceEvent[]>> { | |||
return new Promise((res) => res({ data: global.expectedEvents } as AxiosResponse)); | |||
return new Promise(async (res) => { | |||
await sleep(100, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why sleep(100) and why 100?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sleep is to simulate responses returned by long pooling. The current primitive implementation of this mock unfortunately enforces such workarounds to make it work properly
🎉 This PR is included in version 0.8.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.