private static ExecuteCommand WaitForCommandFromQueue(string[] queues) { if (NeedsReset(connection)) { if (connection != null) { connection.Dispose(); } connection = GetOpenConnection(); } var message = connection.Lists.BlockingRemoveFirst(0, queues, DefaultTimeout); if (message.Result != null) { return(ExecuteCommand.Deserialize(message.Result.Item2)); } return(null); }