Skip to content
Snippets Groups Projects

Create SimpleObservableList and use it for SPIMPipelineProgressViewController

Closed Petr Bainar requested to merge miscStuff into master
1 unresolved thread

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Jan Kožusznik
  • Jan Kožusznik
  • Jan Kožusznik
  • 10
    11 class TaskObservableValueRegistry implements Closeable {
    12
    13 private final BenchmarkJob job;
    14 private final SimpleObservableList<Task> observableTaskList;
    15 private Timer timer;
    16 private boolean isRunning = false;
    17
    18 public TaskObservableValueRegistry(final BenchmarkJob job) {
    19 this.job = job;
    20 this.observableTaskList = new SimpleObservableList<>(new ArrayList<Task>(),
    21 this::evaluateTimer);
    22 }
    23
    24 @Override
    25 public void close() {
    • Same comments as in HaasOutputObservableValueRegistry. Close should be synchronized? Similar mechanism as is in HaasOutputObservableValueRegistry - consider reuse code.

    • Addressed. Synchronization is now in place.

      As for reusing the existing code, although there are notable similarities between HaasOutputObservableValueRegistry and TaskObservableValueRegistry, there are also some differences. For example, the first one works with SimpleObservableValue and keeps an eye on the count of listeners manually, whereas the latter works with SimpleObservableList and keeps track of the interested parties via a different mechanism (there are inherited methods for this purpose).

      Personally, I would like to have a look at a class called ObservableBenchmarkJobRegistry first. Specifically, I suspect that it could be converted into a class analogous to TaskObservableValueRegistry. If this is the case, it would give us a clear hint how code duplication should be eliminated.

      If you are happy with my proposal, I can mark this comment as resolved.

    • Please register or sign in to reply
  • Jan Kožusznik
  • Jan Kožusznik
  • Please register or sign in to reply
    Loading