Herb-AI / HerbSearch.jl

Search procedures and synthesizers for Herb.jl
https://herb-ai.github.io/
MIT License
7 stars 0 forks source link

Fix `max_time` flag using Scala-like futures #80

Open sebdumancic opened 5 months ago

THinnerichs commented 5 months ago

iterate is rolled out to

next = iterate(iter)
while next !== nothing
    (item, state) = next
    # body
    next = iterate(iter, state)
end

according to (https://docs.julialang.org/en/v1/manual/interfaces/).

We should create our own @iterate max_time BFSIterator macro, that does something like

next = iterate(iter)
while next !== nothing
    (item, state) = next
    # body
    task = @spawn iterate(iter, state)
    next = fetch(task)
end
sebdumancic commented 5 months ago

MAybe this post helps: https://discourse.julialang.org/t/simple-timeout-of-function/99578