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

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -