<commit_before>/*
 * Copyright (C) 2019 <NAME> <<EMAIL>>
 * and other copyright owners as documented in the project's IP log.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tv.dotstart.beacon.preload

import javafx.application.Platform
import javafx.beans.property.*
import kotlin.concurrent.thread

/**
 * Manages the execution of pre loading components during application startup.
 *
 * @author [<NAME>](mailto:<EMAIL>)
 */
object Preloader {

  private val loaders = listOf<Loader>()

  private val _description = SimpleStringProperty()
  private val _percentage = SimpleDoubleProperty()
  private val _completed = SimpleBooleanProperty()

  val description: String
    get() = this._description.value
  val descriptionProperty: ReadOnlyStringProperty
    get() = this._description
  val percentage: Double
    get() = this._percentage.value
  val percentageProperty: ReadOnlyDoubleProperty
    get() = this._percentage
  val completed: Boolean
    get() = this._completed.value
  val completedProperty: ReadOnlyBooleanProperty
    get() = this._completed

  operator fun invoke(onComplete: () -> Unit) {
    thread(name = "preload") {
      Platform.runLater {<commit_msg>Created locally defined models for our service definitions.<commit_after>/*
 * Copyright (C) 2019 <NAME> <<EMAIL>>
 * and other copyright owners as documented in the project's IP log.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tv.dotstart.beacon.preload

import javafx.application.Platform
import javafx.beans.property.*
import tv.dotstart.beacon.repository.ServiceRegistry
import kotlin.concurrent.thread

/**
 * Manages the execution of pre loading components during application startup.
 *
 * @author [<NAME>](mailto:<EMAIL>)
 */
object Preloader {

  private val loaders = listOf(
      ServiceRegistry.SystemRepositoryLoader,
      ServiceRegistry.UserRepositoryLoader
  )

  private val _description = SimpleStringProperty()
  private val _percentage = SimpleDoubleProperty()
  private val _completed = SimpleBooleanProperty()

  val description: String
    get() = this._description.value
  val descriptionProperty: ReadOnlyStringProperty
    get() = this._description
  val percentage: Double
    get() = this._percentage.value
  val percentageProperty: ReadOnlyDoubleProperty
    get() = this._percentage
  val completed: Boolean
    get() = this._completed.value
  val completedProperty: ReadOnlyBooleanProperty
    get() = this._completed

  operator fun invoke(onComplete: () -> Unit) {
    thread(name = "preload") {
      Platform.runLater {
{'fraction_non_alphanumeric': 0.08489248813180676, 'fraction_numerical': 0.004468025691147724, 'mean_word_length': 4.161383285302594, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4151446', 'n_tokens_mistral': 936, 'n_tokens_neox': 907, 'n_words': 351}