-// SetVppAdapter sets the adapter that will be used for connections to VPP in the subsequent `Connect` calls.
-func SetVppAdapter(a adapter.VppAPI) {
- vppAdapter = a
+// AsyncConnect asynchronously connects to the VPP API using a new adapter instance
+// created with NewVppAPIAdapter.
+//
+// This call does not block until connection is established, it returns immediately.
+// The caller is supposed to watch the returned ConnectionState channel for connection events.
+// In case of disconnect, the library will asynchronously try to reconnect.
+func AsyncConnect(target string, attempts int, interval time.Duration) (*core.Connection, chan core.ConnectionEvent, error) {
+ return core.AsyncConnect(NewVppAdapter(target), attempts, interval)