'Create a new instance of the Connection object.
:param pika.connection.Parameters parameters: Connection parameters
:param _impl_class: for tests/debugging only; implementation class;
None=default
:raises RuntimeError:'

def __init__(self, parameters=None, _impl_class=None):

    self._event_dispatch_suspend_depth = 0
    self._ready_events = deque()
    self._channels_pending_dispatch = set()
    self._opened_result = _CallbackResult(self._OnOpenedArgs)
    self._open_error_result = _CallbackResult(self._OnOpenErrorArgs)
    self._closed_result = _CallbackResult(self._OnClosedArgs)
    self._user_initiated_close = False
    impl_class = (_impl_class or SelectConnection)
    self._impl = impl_class(parameters=parameters, on_open_callback=self._opened_result.set_value_once, on_open_error_callback=self._open_error_result.set_value_once, on_close_callback=self._closed_result.set_value_once, stop_ioloop_on_close=False)
    self._impl.ioloop.activate_poller()
    self._process_io_for_connection_setup()
