@@ -43,11 +43,6 @@ import scala.runtime.NonLocalReturnControl
4343
4444object BusyWorker {
4545
46- // noinspection ConvertExpressionToSAM
47- implicit def apply [R ](op : => R ): SimpleTask [R ] = new SimpleTask [R ] {
48- def call (): R = op
49- }
50-
5146 implicit def apply (nodes : Seq [Node ]): Seq [jfxs.Node ] = nodes.map(_.delegate)
5247
5348 /**
@@ -252,7 +247,7 @@ class BusyWorker private(val title: String,
252247 *
253248 * Example of running a task without waiting to complete, using a lambda
254249 * {{{
255- * worker.doTask{
250+ * worker.doTask{ () =>
256251 * // Some workload code, does not produce value ot it is discard
257252 * Thread.sleep(1000)
258253 * print(1 + 1)
@@ -262,7 +257,7 @@ class BusyWorker private(val title: String,
262257 * Example of stating a task (with a lambda) and waiting till it finishes and returns a result
263258 * {{{
264259 * // This code will return before workload is completed
265- * val future = worker.doTask{
260+ * val future = worker.doTask{ () =>
266261 * // Some workload code producing final value
267262 * Thread.sleep(1000)
268263 * 1 + 1
@@ -294,7 +289,7 @@ class BusyWorker private(val title: String,
294289 * @param task actions to perform, can be provided a as a lambda op: => R, see examples above.
295290 * @return `Future` that can be used to retrieve result produced the workload, if any.
296291 */
297- def doTask [R ](implicit task : SimpleTask [R ]): Future [R ] = {
292+ def doTask [R ](task : SimpleTask [R ]): Future [R ] = {
298293 doTask(title)(task)
299294 }
300295
@@ -305,7 +300,7 @@ class BusyWorker private(val title: String,
305300 *
306301 * Example of running a task without waiting to complete, using a lambda
307302 * {{{
308- * worker.doTask("My Task") {
303+ * worker.doTask("My Task") { () =>
309304 * // Some workload code, does not produce value ot it is discard
310305 * Thread.sleep(1000)
311306 * print(1 + 1)
@@ -315,7 +310,7 @@ class BusyWorker private(val title: String,
315310 * Example of stating a task (with a lambda) and waiting till it finishes and returns a result
316311 * {{{
317312 * // This code will return before workload is completed
318- * val future = worker.doTask("My Task") {
313+ * val future = worker.doTask("My Task") { () =>
319314 * // Some workload code producing final value
320315 * Thread.sleep(1000)
321316 * 1 + 1
@@ -348,7 +343,7 @@ class BusyWorker private(val title: String,
348343 * @param task actions to perform, can be provided a as a lambda op: => R, see examples above.
349344 * @return `Future` that can be used to retrieve result produced the workload, if any.
350345 */
351- def doTask [R ](name : String )(implicit task : SimpleTask [R ]): Future [R ] = {
346+ def doTask [R ](name : String )(task : SimpleTask [R ]): Future [R ] = {
352347 val jfxTask = new javafx.concurrent.Task [R ] {
353348 override def call (): R = {
354349 task.call()
0 commit comments