Allow more customisation to the polling lifecycle
sneljo1 opened this issue · comments
Is your feature request related to a problem? Please describe.
I am using this library for a couple of different consumers. I would like to re-use it for another one but it has a special case. Currently when a message is deleted (del
), squiss assumes we are ready to receive messages. However, for this special consumer, this is not the case.
Describe the solution you'd like
I was looking through the code but currently it does not seem possible. I would like to use del
where handleMessage is not called automatically. After I am ready to accept new messages, I would like to tell squiss its ok to continue polling.
Possible implementation could be del(pausePolling?:boolean)
and a resume()
or maybe start
would also do the track although it might not be that clear?
Describe alternatives you've considered
Looked at start
and stop
but handleMessage
will override it and don't know if its safe.
This seems like out of the scope of this tool... What I can suggest is to delete the message manually using the AWS API directly, and then call keep() on the message to release the slot of SQUISS
That would probably solve it 👍