Add private _random_connected_conn() to return one of the connect conns

Not really random at this moment...

Signed-off-by: Pedro Melo <melo@simplicidade.org>
This commit is contained in:
Pedro Melo
2014-07-20 22:13:21 +01:00
parent 5142b3a15a
commit 3c1a9a3083

View File

@@ -116,6 +116,12 @@ sub _start_nsqd_connection {
return;
}
## return one connection that is connected
sub _random_connected_conn {
## FIXME: yeah, Sony-style random going on :)
return (values %{ $_[0]{nsqd_conns} })[0]->{conn};
}
#### Hooks for the main states of the connection
sub _connected {