import IQueueMetadataStore from "./IQueueMetadataStore" ; export class implements AsyncIterator < string [ ] > export default class QueueReferredExtentsAsyncIterator implements AsyncIterator < string [ ] > { private unit : number = 1000 ; private done : boolean = false ; private marker ? : number ; constructor ( private readonly queueMetadata ) { } public async next ( ) { if ( this . done ) { return { done : true , value : [ ] } ; } const [ messages , nextMarker ] = await this . queueMetadata . listMessages ( this . unit , this . marker ) ; this . marker = nextMarker ; if ( nextMarker === undefined ) { this . done = true ; } return { done : false , value : messages . map ( ( val ) => val . persistency . id ) } ; } }