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

Implement Watcher #2

Closed
kwiesmueller opened this issue Jul 5, 2018 · 8 comments
Closed

Implement Watcher #2

kwiesmueller opened this issue Jul 5, 2018 · 8 comments
Assignees
Labels
enhancement New feature or request watcher Watcher Package
Projects
Milestone

Comments

@kwiesmueller
Copy link
Member

kwiesmueller commented Jul 5, 2018

Key part of gorcon is to start and manage a games process and restart it if necessary.
This functionality is placed under the internal name "watcher" as the job of this package is to watch a process and monitor it's state implying actions on special events (which might also be external commands).

Implementation of this package should be very generic as usual and offer key functionality for starters.
This means opening an interface for starting, stopping and keeping processes alive.

Acceptance Criteria:

  • Well defined and designed public API for
    • Starting a process
    • Keeping a process alive
    • Stopping a process
    • Subscribing event listeners for process output
  • Functional passing on of context down the action tree for logging, tracing, etc.

Due to the general approach we follow with gorcon, event subscriptions should be handled by channels broadcasting all received process events to the subscribers.
This allows us to attach any kind of listener and allow them to act based on those events through the public API exposed by the watcher.

@kwiesmueller kwiesmueller added enhancement New feature or request watcher Watcher Package labels Jul 5, 2018
@kwiesmueller kwiesmueller added this to the 0.1 milestone Jul 5, 2018
@kwiesmueller kwiesmueller self-assigned this Jul 5, 2018
@kwiesmueller kwiesmueller added this to In progress in Development Jul 5, 2018
@kwiesmueller
Copy link
Member Author

kwiesmueller commented Jul 5, 2018

Remaining subtask at creation of this issue is the final implementation of process
process.go

@IssueHuntBot
Copy link

@kwiesmueller has started working. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@0maxxam0 funded this issue with $1. Visit this issue on Issuehunt

@kwiesmueller
Copy link
Member Author

kwiesmueller commented Jul 6, 2018

After spending the night on this, the process implementation is done, but due to some problems that arose with our tests in the subscription concept for both battleye and the watcher I started overthinking how this was built which might result in drastical changes to the subscription implementation or even an entire rewrite of watcher reducing the need of locks a lot.
Revisiting this part of code after some weeks helped to see the mess that looked so beautiful when it was created.

Updating this issue with further insights and probably a commit after some hours of sleep.

#7 is the related "Bugfix" issue

@IssueHuntBot
Copy link

@0maxxam0 funded this issue with $2. Visit this issue on Issuehunt

@kwiesmueller
Copy link
Member Author

The last push to master solved many problems related to this. Next step is plugging it with OSProcess, testing it in a running example and then finish up the feature with more refactoring.

@kwiesmueller
Copy link
Member Author

Aside from that, Watcher implementation seems complete.

@IssueHuntBot
Copy link

@kwiesmueller has rewarded $2.10 to @kwiesmueller. See it on IssueHunt

  • 💰 Total deposit: $3.00
  • 🎉 Repository reward(20%): $0.60
  • 🔧 Service fee(10%): $0.30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request watcher Watcher Package
Projects
Development
  
Done
Development

No branches or pull requests

2 participants