Graur / eo-threads

EO Objects for Managing Execution Threads

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

Hits-of-Code Lines of code License

EO objects for managing execution threads.

To run slow code in a new thread and wait for its finish in a loop:

while.
  is-running.
    start.
      QQ.threads.thread > t
        [x]
          very-slow-object > @
  [i]
    seq > @
      QQ.io.stdout
        "still waiting..."
      QQ.threads.sleep
        QQ.dt.millisecond.mul 100
      if.
        i.gt 10
        t.stop
        TRUE

The object thread has attributes:

  • start starts the thread or does nothing if it's already running
  • is-running is TRUE if it is still working
  • stop immediately terminates it

Dataization of the thread object means waiting for its finish. If the thread is terminated, dataization returns error.

How to Contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full Maven build:

$ mvn clean install -Pqulice

You will need Maven 3.3+ and Java 8+.

About

EO Objects for Managing Execution Threads