Closed bceskavich closed 1 year ago
Thanks for the PR.
I think that if you require using this function, vendoring it into your own codebase is definitely the correct approach. Generating a request_id is internal to plug, and probably not something the plug team should be maintaining as a public API for generating unique id.
The problem with making it public is that people can then start assuming it remains within a certain size or with a certain criteria, none of which we want to guarantee, so my suggestion is to copy and paste it around indeed. :) Thanks for the PR and the nice words! :heart:
Thanks @Gazler + @josevalim for the quick response and the reasoning, cheers!
We love Plug over at Knock!
Recently we've encountered a couple cases where we wish to generate an ad hoc request id outside of our Plug pipelines. To do so, we've copied logic in
Plug.RequestId.generate_request_id/0
into a utility function in our own codebase. We think it would be quite useful to expose the function publicly via Plug itself.