parameters: (stocklist, source='sina', use_proxy=False, batch_func=None)
return_statement: return result
docstring: 并发网络请求获取实时数据，获取失败时，抛出异常
  
      :param list stocklist: 股票名称列表，股票名称示例：sh000001, sz000001
      :param str source: 使用 sina 还是 qq 作为数据来源
      :param boolean: use_proxy: 是否使用代理
      :param function batch_func: 当网络请求返回一个批次数据时，调用该函数，通常用于向数据库写入数据
docstring_summary: 并发网络请求获取实时数据，获取失败时，抛出异常
docstring_tokens: 并发网络请求获取实时数据，获取失败时，抛出异常
function: def get_spot_parallel(stocklist, source='sina', use_proxy=False, batch_func=None):
      """并发网络请求获取实时数据，获取失败时，抛出异常
  
      :param list stocklist: 股票名称列表，股票名称示例：sh000001, sz000001
      :param str source: 使用 sina 还是 qq 作为数据来源
      :param boolean: use_proxy: 是否使用代理
      :param function batch_func: 当网络请求返回一个批次数据时，调用该函数，通常用于向数据库写入数据
      """
      if source == 'sina':
          queryStr = "http://hq.sinajs.cn/list="
          max_size = 140
          parse_one_result = parse_one_result_sina
      else:
          queryStr = "http://qt.gtimg.cn/q="
          max_size = 60
          parse_one_result = parse_one_result_qq
      count = 0
      tmpstr = queryStr
      batchs = []
      for stock in stocklist:
          tmpstr += ("%s,") % (stock)
          count += 1
          if count >= max_size:
              batchs.append(tmpstr)
              count = 0
              tmpstr = queryStr
      if tmpstr != queryStr:
          batchs.append(tmpstr)
  
      def request_inner(url):
          batch_result = request_data(url, parse_one_result, use_proxy)
          if batch_func and batch_result:
              batch_func(batch_result)
          return batch_result
  
      with futures.ThreadPoolExecutor() as executor:
          res = executor.map(request_inner, batchs, timeout=2)
  
      result = []
      for batch_result in res:
          if batch_result:
              result.extend(batch_result)
      return result
function_tokens: def get_spot_parallel ( stocklist , source = 'sina' , use_proxy = False , batch_func = None ) : if source == 'sina' : queryStr = "http://hq.sinajs.cn/list=" max_size = 140 parse_one_result = parse_one_result_sina else : queryStr = "http://qt.gtimg.cn/q=" max_size = 60 parse_one_result = parse_one_result_qq count = 0 tmpstr = queryStr batchs = [ ] for stock in stocklist : tmpstr += ( "%s," ) % ( stock ) count += 1 if count >= max_size : batchs . append ( tmpstr ) count = 0 tmpstr = queryStr if tmpstr != queryStr : batchs . append ( tmpstr ) def request_inner ( url ) : batch_result = request_data ( url , parse_one_result , use_proxy ) if batch_func and batch_result : batch_func ( batch_result ) return batch_result with futures . ThreadPoolExecutor ( ) as executor : res = executor . map ( request_inner , batchs , timeout = 2 ) result = [ ] for batch_result in res : if batch_result : result . extend ( batch_result ) return result