Skip to content

loop and short-circuiting #166

Open
Open
@prepor

Description

@prepor

Hello. Is this code supposed to stop loop execution?

(require '[manifold.deferred :as deferred]
           '[manifold.stream :as stream]
           '[manifold.time :as mt])
  (->
   (deferred/loop []
     (prn "---TICK!")
     (mt/in 200 #(deferred/recur)))
   (deferred/timeout! 1000)
   (deref))

Currently, it loops forever and for me, it looks as broken API. Maybe loop should check result# before each tick?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions