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
- async ndn_python_repo.utils.concurrent_fetcher(app, name, start_id, end_id, semaphore, **kwargs)
An async-generator to fetch data packets between “name/start_id” and “name/end_id” concurrently.
- Parameters:
app (
NDNApp) – NDNApp.name (
Union[Iterable[Union[bytes,bytearray,memoryview,str]],str,bytes,bytearray,memoryview]) – NonStrictName. Name prefix of Data.start_id (
int) – int. The start number.end_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.