J
- Source
- __.scala
Member
Alias
Def
Fail with illegal argument
Fail with illegal argument
Inlines throw new IllegalArgumentException()
The only benefit is reducing boilerplate code
- Source
- __.scala
Fail with illegal state
Fail with illegal state
Inlines throw new IllegalStateException()
The only benefit is reducing boilerplate code
- Source
- __.scala
Schedule job
Schedule job
Schedules a job to run every given period
// Prints time every 1 second for the rest of the day
val day = Day()
App.Concurrent.runEvery(1.Seconds, Time.current.tp).cancelIf(day != Day())
- Source
- __.scala
Schedule start of job
Schedule start of job
Schedules a job with given initDelay, which will run every given period
// In 10 minutes, this will start printing time every 1 second for one hour
Schedule.everyIn(1.Second, 10.Minutes, Time.current.tp).expireIn(1.Hour)
- Source
- __.scala
Schedule one time job
Schedule one time job
Schedules a one time job with given delay
// Prints "Hello" in 3 seconds
J.scheduleIn(3.Seconds, "Hello".tp)
- Source
- __.scala
Pauses current execution thread
Pauses current execution thread
J.sleep(10.Millis) // Pauses for 10 milliseconds
J.sleep(2.Seconds) // Pauses for 2 seconds
J.sleep(1.Minute) // Pauses for 1 minute
- Source
- __.scala
To Do tag
To Do tag
Inlines throw new UnsupportedOperationException()
'J.toDo' is the tag to leave in code to search for later.
Never use ???, which is for debugging and short term playing around
- Source
- __.scala
Fail unsupported
Fail unsupported
Inlines throw new UnsupportedOperationException()
The only benefit is reducing boilerplate code
- Source
- __.scala