mreinstein / node-gearman

⚙ Gearman client and worker for node
75 stars 13 forks source link

client.connect() not working in 2.0 #19

Closed fractalf closed 7 years ago

fractalf commented 7 years ago

I get TypeError: client.connect is not a function when trying to connect and sumbit a job.

Looking at the code it doesn't look like it's exposed:

let result = { close, echo, getJobStatus, getJobStatusUnique,
           setOption, submitJob, addFunction, preSleep, grabJob, grabUniqueJob,
           sendWorkStatus, sendWorkFail, sendWorkComplete, sendWorkData, on,
           sendWorkException, sendWorkWarning, setWorkerId, adminStatus,
adminWorkers, removeFunction, resetAbilities, removeEventListener };

no connect! I tried adding it, but then I got another error:

TypeError: Cannot read property '_parsePacket' of undefined
    at _handlePacket (/.../node_modules/gearman/index.js:428:24)

and that's where my debug ends right now. Can you look into this? I'll use 1.0.1 until fixed :)

mreinstein commented 7 years ago

sorry about that. I'll take a look this morning!

mreinstein commented 7 years ago

I just published 2.0.2 which exposes connect() and removes all references to this. See if this solves your problem(s).

fractalf commented 7 years ago

That fixed it, cheers!