Closed redwrx closed 2 years ago
We'd love to have this merged as it would make the Sneakers jobs look much better in Elastic APM (see https://github.com/elastic/apm-agent-ruby/pull/676#issue-360412848) ➕!
Thanks, looks like a great idea. would this break compatibility with existing middleware? (if so, is there a way to make it backwards compatible?)
Seems to me this would be breaking as the position of all arguments get shifted. Without knowing much about the rest of the codebase, one way to not be breaking would be to add self
to one of the currently passed arguments, eg metadata[:worker] = self
.
Interesting. I would also accept having two different signatures, one with this and one without (older one). Would you be willing to submit a PR or augment this one to be backward compatible? if so I'd be happy to merge of course
Interesting. I would also accept having two different signatures, one with this and one without (older one). Would you be willing to submit a PR or augment this one to be backward compatible? if so I'd be happy to merge of course
I agree and will update this PR to follow @mikker approach
Interesting. I would also accept having two different signatures, one with this and one without (older one). Would you be willing to submit a PR or augment this one to be backward compatible? if so I'd be happy to merge of course
I pushed the code that uses metadata to pass around the worker name. It passes all tests for all ruby versions, except Ruby-head. Seems like there is a bug with minitest that prevents the tests to run successfully
ArgumentError: wrong number of arguments (given 2, expected 1)
@jondot
a minor change to pass the worker object to the middleware call https://github.com/jondot/sneakers/issues/415