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

Client Polling #14

Open
sellis opened this issue Sep 15, 2015 · 3 comments
Open

Client Polling #14

sellis opened this issue Sep 15, 2015 · 3 comments

Comments

@sellis
Copy link

sellis commented Sep 15, 2015

Hi Jeff,

Great node module you made here! Very impressive work.

I have a rest work flow that involves a client starting with a post request to submit a job, getting redirected to a job status page, and then polling that page (get) until a certain json element on it has the value "Complete".

I see everything I need in your API except the client polling part.

I don't see a way to tell bench-rest to loop and perform the same get request over and over again in the after hook until the verification step passes (job is complete). Maybe I'm missing something

Any advice you have would be most appreciated.

Thanks again for a creating a great node module!

Cheers,
Scott Ellis

@jeffbski
Copy link
Owner

Thanks Scott.

I don't currently have a way to do polling in the flow. The hooks API is synchronous so it doesn't have a way to poll.

I did create an experimental branch for another user which you can install using npm install jeffbski/bench-rest#delayAfter which adds a delayAfter option in milliseconds that it will delay before doing the next item in the flow.

So if you can have it delay x msecs then continue and hopefully the item is there.

I'm not sure this is a good solution since under load it can vary how long it takes for something to complete. So polling like you mentioned would be better, but I'm not sure about benchmarking with something like that. It seems like if it ends up taking an extra poll or two for something to show up the benchmarking would be all over the place.

I'll give it some thought, but I'm not sure I have a good idea about a solution.

@sellis
Copy link
Author

sellis commented Sep 17, 2015

Thanks a lot for your response Jeff. I understand the complications. I wonder if it would be possible to call the before and after hooks in an async manner?

@jeffbski
Copy link
Owner

@sellis I guess that might be a possibility. Let me go down that route and see if that will work.

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