--- !ruby/object:RI::MethodDescription 
aliases: []

block_params: 
comment: 
- !ruby/struct:SM::Flow::P 
  body: "Returns one of:"
- !ruby/object:SM::Flow::LIST 
  contents: 
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>PGRES_POLLING_READING</tt> - wait until the socket is ready to read
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>PGRES_POLLING_WRITING</tt> - wait until the socket is ready to write
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>PGRES_POLLING_FAILED</tt> - the asynchronous connection has failed
  - !ruby/struct:SM::Flow::LI 
    label: "*"
    body: <tt>PGRES_POLLING_OK</tt> - the asynchronous connection is ready
  type: :BULLET
- !ruby/struct:SM::Flow::P 
  body: "Example:"
- !ruby/struct:SM::Flow::VERB 
  body: "  conn = PGconn.connect_start(&quot;dbname=mydatabase&quot;)\n  socket = IO.for_fd(conn.socket)\n  status = conn.connect_poll\n  while(status != PGconn::PGRES_POLLING_OK) do\n    # do some work while waiting for the connection to complete\n    if(status == PGconn::PGRES_POLLING_READING)\n      if(not select([socket], [], [], 10.0))\n        raise &quot;Asynchronous connection timed out!&quot;\n      end\n    elsif(status == PGconn::PGRES_POLLING_WRITING)\n      if(not select([], [socket], [], 10.0))\n        raise &quot;Asynchronous connection timed out!&quot;\n      end\n    end\n    status = conn.connect_poll\n  end\n  # now conn.status == CONNECTION_OK, and connection\n  # is ready.\n"
full_name: PGconn#connect_poll
is_singleton: false
name: connect_poll
params: |
  conn.connect_poll() -> Fixnum

visibility: public
