aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/control/concurrency/process.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/lux/control/concurrency/process.lux')
-rw-r--r--stdlib/source/lux/control/concurrency/process.lux48
1 files changed, 24 insertions, 24 deletions
diff --git a/stdlib/source/lux/control/concurrency/process.lux b/stdlib/source/lux/control/concurrency/process.lux
index c7f9ae82e..322300a17 100644
--- a/stdlib/source/lux/control/concurrency/process.lux
+++ b/stdlib/source/lux/control/concurrency/process.lux
@@ -15,26 +15,26 @@
[//
["." atom (#+ Atom)]])
-(`` (for {(~~ (static host.jvm))
- (as-is (import: java/lang/Object)
+(`` (for {(~~ (static host.old))
+ (as-is (import: #long java/lang/Object)
- (import: java/lang/Runtime
- (#static getRuntime [] Runtime)
+ (import: #long java/lang/Runtime
+ (#static getRuntime [] java/lang/Runtime)
(availableProcessors [] int))
- (import: java/lang/Runnable)
+ (import: #long java/lang/Runnable)
- (import: java/util/concurrent/TimeUnit
+ (import: #long java/util/concurrent/TimeUnit
(#enum MILLISECONDS))
- (import: java/util/concurrent/Executor
- (execute [Runnable] #io void))
+ (import: #long java/util/concurrent/Executor
+ (execute [java/lang/Runnable] #io void))
- (import: (java/util/concurrent/ScheduledFuture a))
+ (import: #long (java/util/concurrent/ScheduledFuture a))
- (import: java/util/concurrent/ScheduledThreadPoolExecutor
+ (import: #long java/util/concurrent/ScheduledThreadPoolExecutor
(new [int])
- (schedule [Runnable long TimeUnit] #io (ScheduledFuture Object))))}
+ (schedule [java/lang/Runnable long java/util/concurrent/TimeUnit] #io (java/util/concurrent/ScheduledFuture java/lang/Object))))}
## Default
(type: Process
@@ -45,17 +45,17 @@
(def: #export parallelism
Nat
- (`` (for {(~~ (static host.jvm))
- (|> (Runtime::getRuntime)
- (Runtime::availableProcessors)
+ (`` (for {(~~ (static host.old))
+ (|> (java/lang/Runtime::getRuntime)
+ (java/lang/Runtime::availableProcessors)
.nat)}
## Default
1)))
(def: runner
- (`` (for {(~~ (static host.jvm))
- (ScheduledThreadPoolExecutor::new (.int ..parallelism))}
+ (`` (for {(~~ (static host.old))
+ (java/util/concurrent/ScheduledThreadPoolExecutor::new (.int ..parallelism))}
## Default
(: (Atom (List Process))
@@ -63,15 +63,15 @@
(def: #export (schedule milli-seconds action)
(-> Nat (IO Any) (IO Any))
- (`` (for {(~~ (static host.jvm))
- (let [runnable (object [] [Runnable]
+ (`` (for {(~~ (static host.old))
+ (let [runnable (object [] [java/lang/Runnable]
[]
- (Runnable [] (run) void
- (io.run action)))]
+ (java/lang/Runnable [] (run) void
+ (io.run action)))]
(case milli-seconds
- 0 (Executor::execute runnable runner)
- _ (ScheduledThreadPoolExecutor::schedule runnable (.int milli-seconds) TimeUnit::MILLISECONDS
- runner)))}
+ 0 (java/util/concurrent/Executor::execute runnable runner)
+ _ (java/util/concurrent/ScheduledThreadPoolExecutor::schedule runnable (.int milli-seconds) java/util/concurrent/TimeUnit::MILLISECONDS
+ runner)))}
## Default
(atom.update (|>> (#.Cons {#creation ("lux io current-time")
@@ -79,7 +79,7 @@
#action action}))
runner))))
-(`` (for {(~~ (static host.jvm))
+(`` (for {(~~ (static host.old))
(as-is)}
## Default