followAegleMaster :: ManagedZK -> IO (IO ZKError, AdvSTM (Maybe BaseUrl))
followAegleMaster zk = do
    var <- atomically $ newTVar Nothing
    let followThread = followLeaderInfo zk A.zkNode var
    pure (followThread, getUrl var)
  where
    getUrl var = fmap toURI . (A.parseZKData =<<) . join <$> readTVar var
    toURI (host, port) = BaseUrl Http host (fromIntegral port)
followAegleMaster :: ManagedZK -> IO (IO ZKError, AdvSTM (Maybe BaseUrl))
followAegleMaster zk = do
    var <- atomically $ newTVar Nothing
    let followThread = followLeaderInfo zk A.zkNode var
    pure (followThread, getUrl var)
  where
    getUrl var = fmap toURI . (A.parseZKData =<<) . join <$> readTVar var
    toURI (host, port) = BaseUrl Http host (fromIntegral port)
followAegleMaster zk = do
    var <- atomically $ newTVar Nothing
    let followThread = followLeaderInfo zk A.zkNode var
    pure (followThread, getUrl var)
  where
    getUrl var = fmap toURI . (A.parseZKData =<<) . join <$> readTVar var
    toURI (host, port) = BaseUrl Http host (fromIntegral port)