Skip to content

Make pmtiles.Extract(...) cancellable with own context #245

Open

Description

@marcogerstmann

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.

Activity

  1. bdon commented on Sep 30, 2025

    @bdon
    Member

    Do you just want to pass in a Context to Extract instead of using context.Background ?

  2. marcogerstmann commented on Sep 30, 2025

    @marcogerstmann
    ContributorAuthor

    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.

  3. added a commit that references this issue on Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions