aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/concurrency/actor.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-12-10 15:26:36 -0400
committerEduardo Julian2017-12-10 15:26:36 -0400
commit859c7485cd0e9ebe8d456ed58238bdec849bd6e1 (patch)
treeb854f14eb921d8567e4c06f38d1149a0659ff0a4 /stdlib/source/lux/concurrency/actor.lux
parent6352437a8403b09fa0c83843984323ce1e67e980 (diff)
- Some minor refactoring.
- Eliminated the dependency of STM upon FRP.
Diffstat (limited to 'stdlib/source/lux/concurrency/actor.lux')
-rw-r--r--stdlib/source/lux/concurrency/actor.lux14
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/lux/concurrency/actor.lux b/stdlib/source/lux/concurrency/actor.lux
index 3a032e00f..4c98d10e4 100644
--- a/stdlib/source/lux/concurrency/actor.lux
+++ b/stdlib/source/lux/concurrency/actor.lux
@@ -45,8 +45,8 @@
## TODO: Delete after new-luxc becomes the new standard compiler.
(def: (actor mailbox obituary)
(All [s] (-> (Atom <Mailbox>) (Promise <Obituary>) (Actor s)))
- (@abstract {#mailbox mailbox
- #obituary obituary}))
+ (@abstraction {#mailbox mailbox
+ #obituary obituary}))
(type: #export (Message s)
<Message>)
@@ -66,7 +66,7 @@
self (actor (atom (promise #.None))
(promise #.None))
process (loop [state init
- |mailbox| (io.run (atom.read (get@ #mailbox (@repr self))))]
+ |mailbox| (io.run (atom.read (get@ #mailbox (@representation self))))]
(do promise.Monad<Promise>
[[head tail] |mailbox|
?state' (handle head state self)]
@@ -75,7 +75,7 @@
(do @
[_ (end error state)]
(exec (io.run (promise.resolve [error state (#.Cons head (obituary tail))]
- (get@ #obituary (@repr self))))
+ (get@ #obituary (@representation self))))
(wrap [])))
(#e.Success state')
@@ -84,7 +84,7 @@
(def: #export (alive? actor)
(All [s] (-> (Actor s) Bool))
- (case (promise.poll (get@ #obituary (@repr actor)))
+ (case (promise.poll (get@ #obituary (@representation actor)))
#.None
true
@@ -97,7 +97,7 @@
(if (alive? actor)
(let [entry [message (promise #.None)]]
(do Monad<IO>
- [|mailbox| (atom.read (get@ #mailbox (@repr actor)))]
+ [|mailbox| (atom.read (get@ #mailbox (@representation actor)))]
(loop [|mailbox| |mailbox|]
(case (promise.poll |mailbox|)
#.None
@@ -105,7 +105,7 @@
[resolved? (promise.resolve entry |mailbox|)]
(if resolved?
(do @
- [_ (atom.write (product.right entry) (get@ #mailbox (@repr actor)))]
+ [_ (atom.write (product.right entry) (get@ #mailbox (@representation actor)))]
(wrap true))
(recur |mailbox|)))