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

'submited' event can never be listened on #17

Closed
atrniv opened this issue Aug 7, 2014 · 2 comments
Closed

'submited' event can never be listened on #17

atrniv opened this issue Aug 7, 2014 · 2 comments
Assignees
Labels

Comments

@atrniv
Copy link

atrniv commented Aug 7, 2014

In the client.submitJob function the tryToSend function ultimately results in a synchronous socket.write.

As a result the tryToSend is really synchronous when it seems to be asynchronous. The result of this is that the jsSendCallback gets executed synchronously as well, thereby emitting the submited event on the job even before the job has actually been returned.

So any listener which attaches to the job on the submited event will never be fired.

Perhaps the tryToSend function should be wrapped in a process.nextTick to ensure it gets called only after the job has actually be returned, and an event listener is attached to it.

atrniv pushed a commit to atrniv/GearmaNode that referenced this issue Aug 7, 2014
@veny
Copy link
Owner

veny commented Aug 20, 2014

hi atrniv,
you are partially right. the problem is related only to a client already connected to job server. the solution introduced in your branch breaks my unit tests.

i will try to find a fix during the comming weekend.

best regards,
veny

@veny veny added bug and removed bug labels Aug 21, 2014
@veny veny self-assigned this Aug 21, 2014
veny added a commit that referenced this issue Aug 24, 2014
@veny
Copy link
Owner

veny commented Aug 24, 2014

solved in release v0.1.8

@veny veny closed this as completed Aug 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants