Skip to content

Commit

Permalink
fix e/Offload
Browse files Browse the repository at this point in the history
  • Loading branch information
leonoel committed Dec 11, 2024
1 parent 928d571 commit 5b34912
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/hyperfiddle/electric3.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -473,15 +473,9 @@ inhibit undesired duplicate effects with code like (if x a a) or (or a1 a2)."
([t] (join (task->incseq t)))
([t init-v] (input (initialized t init-v)))))

#?(:clj (cc/defn -offload [tsk executor]
(flow->incseq (m/ap (try (m/? (m/via-call executor (m/?< (mx/poll-task tsk))))
(catch Cancelled _ (m/amb)))))))


(hyperfiddle.electric3/defn Offload
([f!] ($ Offload f! m/blk))
([f! executor] (server (let [mbx (m/mbx)] (mbx f!) (join (-offload mbx executor))))))

([f!] (server (f!)))
([f! _] (server (f!))))

(hyperfiddle.electric3/declare ^{:doc "Bound to the HTTP request of the page in which the current Electric program is running."}
http-request)
Expand Down

0 comments on commit 5b34912

Please sign in to comment.