You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
atrniv
pushed a commit
to atrniv/GearmaNode
that referenced
this issue
Aug 7, 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.
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 thesubmited
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 aprocess.nextTick
to ensure it gets called only after the job has actually be returned, and an event listener is attached to it.The text was updated successfully, but these errors were encountered: