Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another try #22

Merged
merged 3 commits into from
Nov 19, 2020
Merged

another try #22

merged 3 commits into from
Nov 19, 2020

Conversation

PeterPetrik
Copy link
Contributor

another try of API

@abellgithub
Copy link
Collaborator

abellgithub commented Nov 18, 2020

How about something like:

typedef <something opaque> Untwine;

Untwine u;
void untwineStart(&u, InputFiles, OutputSpecification, Options);
void untwineStop(&u);
Feedback untwineStatus(&u);

This would allow untwine to do whatever with the Untwine structure without locking or anything and would also support multiple running instances.

@PeterPetrik
Copy link
Contributor Author

how would you request cancellation to the running process?

@abellgithub
Copy link
Collaborator

call untwineStop()

Are you expecting this to run in a separate process? I assumed that you would create that process or a thread from within your code if that's what you want. Is this incorrect?

@abellgithub
Copy link
Collaborator

I've been thinking about this a little more and wondered more about the actual interface. Perhaps this is best done by simply forking a process with a pipe that can be read by the parent. This could all be hidden behind the interface, but then stopping would simply amount to killing the process. Untwine uses PDAL, which isn't really interruptible. I could put code in to stop around the PDAL input and output, but you could still end up with pretty long wait times. I'm not sure what you're expecting.

Also, I'm not sure what to do about progress. There are steps, but it's more likely to be something like a bad MS progress bar where some bits go fast and other bits go slow. Perhaps I could put in some progress info that could be passed through whatever interface we decide, and then later you could figure out how you want to label it (0-100 or whatever).

@PeterPetrik
Copy link
Contributor Author

PeterPetrik commented Nov 19, 2020

  • with interface, I am easy with your option too 👍
  • re progress: the progress should always increase and has some kind-of regular updates. I am not worried too much that it will not be smooth (expecting MS progress bar experience, but we will not try to predict the remaining time :))
  • re interuption: it is OK if you cancel the process on the first possible opportunity. I understand it could be let say after a minute after user action...

@abellgithub abellgithub merged commit 01bd18e into hobuinc:main Nov 19, 2020
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