ConSol-Monitoring / mod-gearman-worker-go

Mod-Gearman Worker rewrite in Golang
GNU General Public License v3.0
7 stars 10 forks source link

Adding ability to send answer to dupservers asynchronously -- Queue implementation #14

Closed infraweavers closed 4 years ago

infraweavers commented 4 years ago

@sni this is our first stab at this, is this the kind of approach you were thinking of in: https://github.com/ConSol/mod-gearman-worker-go/pull/13

sni commented 4 years ago

Thanks for the PR, looks quite good already.

infraweavers commented 4 years ago

@sni cool; we'll address all this today. Thanks for the feedback!

sni commented 4 years ago

pusing non blocking into a channel can be done like this:

select {
    case channel <- message:
        // message sent
    default:
        // message dropped, maybe increase a drop counter and log the number of droped messages every once in a while
}
infraweavers commented 4 years ago

@sni We think we've made all these changes; so it should be ready for review again now

infraweavers commented 4 years ago

@sni We think we've addressed those issues and we've introduced a controlling system to handle reloads/restarts gracefully

sni commented 4 years ago

Looks good. Thanks for your work. Just one thing, is it really required to have a response channel? I mean, if the sender waits till the dubconsumer reads from the termination channel, wouldn't that be sufficient already?

infraweavers commented 4 years ago

@sni You are correct, we have removed the response channel and switched to using an unbuffered terminationchannel and that behaves the same!

infraweavers commented 4 years ago

@sni Is this all good to be merged or is there any other change needed?

sni commented 4 years ago

no, everything is good, just didn't have time yet :)

infraweavers commented 4 years ago

@sni is there any chance of getting this into the OMD nightly? We'd love to be able to test it in our pre-production environment :)

sni commented 4 years ago

this should be in the omd nightly already. If in doubt, ./bin/mod_gearman_worker-go -V tells you the exact git commit hash.