ConcurrentFetcher package

Introduction

Fetch data packets in parallel using a fixed window size.

Note that the type Union[Iterable[Union[bytes, bytearray, memoryview, str]], str, bytes, bytearray, memoryview] in the documentation is equivalent to the ndn.name.NonStrictName type.

Reference

ndn_python_repo.utils.concurrent_fetcher(app, name, start_block_id, end_block_id, semaphore, **kwargs)

An async-generator to fetch data packets between “name/start_block_id” and “name/end_block_id” concurrently.

Parameters
  • app (NDNApp) – NDNApp.

  • name (Union[Iterable[Union[bytes, bytearray, memoryview, str]], str, bytes, bytearray, memoryview]) – NonStrictName. Name prefix of Data.

  • start_block_id (int) – int. The start segment number.

  • end_block_id (Optional[int]) – Optional[int]. The end segment number. If not specified, continue fetching until an interest receives timeout or nack or 3 times.

Returns

Yield (FormalName, MetaInfo, Content, RawPacket) tuples in order.