Last active
March 23, 2018 17:03
-
-
Save oahayder/84ed6e9ec606f1bd602029796af1b7ef to your computer and use it in GitHub Desktop.
Require yeild workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local resty_dogstatsd = require "resty_dogstatsd" | |
--BAD. Module level objects | |
local dogstatsd, err = resty_dogstatsd.new({...}) | |
-- GOOD. Construct connection at runtime | |
local function get_dogstatsd() | |
local dogstatsd, err = resty_dogstatsd.new({...}) | |
return dogstatsd | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment