You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make pmtiles.Extract(...) cancellable with own context #245
Hi, we are calling pmtiles.Extract() in our Go service and need the possibility to cancel the currently running extraction. For this we would like to be able to pass our own context to the method.
Yes, because I want to be able to cancel a running extraction when I get a new request for an extraction in my Go service, which make the currently running extraction obsolete. What I am doing currently is to run the binary of go-pmtiles in a exec.CommandContext(), so that it runs in a process that I can entirely kill, so that this process can't occupy resources anymore.
Ideally I am able to use pmtiles.Extract() with a context I can create myself, like context.WithCancel(context.Background()), instead of calling a binary from my Go code.
This would of course imply that the current usage of context in pmtiles.Extract() is making use of the context in all meaningful places that should be cancellable.
Activity
bdon commentedon Sep 30, 2025
Do you just want to pass in a
ContexttoExtractinstead of usingcontext.Background?marcogerstmann commentedon Sep 30, 2025
Yes, because I want to be able to cancel a running extraction when I get a new request for an extraction in my Go service, which make the currently running extraction obsolete. What I am doing currently is to run the binary of go-pmtiles in a
exec.CommandContext(), so that it runs in a process that I can entirely kill, so that this process can't occupy resources anymore.Ideally I am able to use
pmtiles.Extract()with a context I can create myself, likecontext.WithCancel(context.Background()), instead of calling a binary from my Go code.This would of course imply that the current usage of context in
pmtiles.Extract()is making use of the context in all meaningful places that should be cancellable.add ctx parameter to extract [#245] (#252)