ruby - Is it safe to reuse Faraday connection objects? -


is safe reuse faraday connection objects, or better recreate them every time?

def connection   @connection ||= faraday.new('http://example.com') |conn|     conn.request :url_encoded     # more configuration   end end 

i think it's safe reuse them (i have, lot). don't see covered 1 way or in documentation presence of "per-request options" (as opposed per-connection) @ least implies can rely on making multiple requests same connection.


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -