You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As outlined in #3, it may be useful to cache connections for SSHKit.Contexts so subsequent commands do not have to set up a new one each time.
Open questions/things to do:
How do we cache connections?
should be a KV-store erlang process
probably store connections by {hostname, port, username} as the key?
commands always go to this process to fetch a connection
if a connection with the same key doesn't exist yet, create, cache and return it
else: return the cached connection unless it timed-out
so it's more of a "connection provider" than just a "cache"
How do we reuse the cached connections?
do we pass them in to the SSHKit.run and .upload functions?
do these methods access the (global) cache process?
Thoughts:
use GenServer for the connection provider
could be set as part of the context, but have a default value so you do not need to explicitly pass it when just using the DSL
context=SSHKit.context(hosts,provider: SSHKit.ConnectionProvider.new)# in SSHKitdefcontext(hosts,options\\[provider: SSHit.ConnectionProvider.default])
…
enddefrun(context,command)do# fetch connections from the context's connection provider# executeend
The text was updated successfully, but these errors were encountered:
Closing this. I think that making the connection explicit to enable re-use is a better next goal (see first draft in #138). Once that's achieved, connection caching could be implemented on top/outside of SSHKit.
As outlined in #3, it may be useful to cache connections for
SSHKit.Context
s so subsequent commands do not have to set up a new one each time.Open questions/things to do:
{hostname, port, username}
as the key?SSHKit.run
and.upload
functions?Thoughts:
GenServer
for the connection providerThe text was updated successfully, but these errors were encountered: