Skip to content

A proof-of-concept for a long-running function#12722

Closed
Byron wants to merge 2 commits intogitbutlerapp:masterfrom
Byron:next5
Closed

A proof-of-concept for a long-running function#12722
Byron wants to merge 2 commits intogitbutlerapp:masterfrom
Byron:next5

Conversation

@Byron
Copy link
Collaborator

@Byron Byron commented Mar 7, 2026

For but-lite we need a way to deal with (potentially) long-running operations.

The PoC presented here is pretty much based on what gix does when it comes to progress and cancellation.

Tasks

  • PoC callee
  • but-testing integration to see the Rust side

Notes for the Reviewer

You can work backwards from cargo run -p but-testing -- long-running -d 5s, which represents a Rust caller.


estib Tasks

  • napi export of a function using this
  • How does this work on JS land?

@vercel
Copy link

vercel bot commented Mar 7, 2026

@Byron is attempting to deploy a commit to the GitButler Team on Vercel.

A member of the Team first needs to authorize it.

While it's using `gix::Progress`, it could also use anything else for that.
There might also be alternatives that offer checks for cancellation as part of the progress,
but I found it better to make this explcit.

Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
That's particularly interesting for the Progress visualisation
and instantiation, as our 'renderer' would be a forwarder of
sorts to pass the progress state on to the frontend.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
@estib-vega
Copy link
Contributor

@Byron I hope it's fine that I pushed a commit to this PR. Can't build a stack from a fork branch (I think).

Basically, I added a two Napi functions:

  • One that creates a long running task, and emits updates through a callback
  • One that cancels the task.

I added a POC of how that works in the test.ts in the but-sdk side of things and it seems to work nicely

@estib-vega
Copy link
Contributor

ohhhh I can't push

@estib-vega
Copy link
Contributor

I created this PR: #12802

@Byron
Copy link
Collaborator Author

Byron commented Mar 12, 2026

Sorry for the hassle, I should have remembered to push into this repository.
Also, you should be able to push into my fork, for all I know, this is enabled.

Screenshot 2026-03-13 at 06 48 26

In any case, closing this as superseded by #12802 .

@Byron Byron closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants