Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #8 from invenia/pointsix
Browse files Browse the repository at this point in the history
Support 0.6
  • Loading branch information
iamed2 authored Apr 18, 2017
2 parents 14acc21 + 0b31e90 commit 7fd7e38
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ os:
- linux
- osx
julia:
- release
- 0.5
- 0.6
- nightly
matrix:
allow_failures:
Expand Down
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
julia 0.5
LightGraphs 0.7.0 0.8.0
julia 0.5 0.7-
LightGraphs 0.7.0
Iterators 0.2.0
DeferredFutures 0.3.0
DataStructures 0.5.0
Expand Down
28 changes: 22 additions & 6 deletions src/executors.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import Iterators: chain

if VERSION >= v"0.6.0-dev.2830"
import Base.Distributed: wrap_on_error, wrap_retry
elseif VERSION >= v"0.6.0-dev.2603"
import Base.Parallel: wrap_on_error, wrap_retry
else
import Base: wrap_on_error, wrap_retry
end

"""
An `Executor` handles execution of [`DispatchContext`](@ref)s.
Expand Down Expand Up @@ -373,12 +381,16 @@ function dispatch!(exec::Executor, ctx::DispatchContext; throw_error=true)
for more details.
```
=#
f = Base.wrap_on_error(
Base.wrap_retry(
retry_args = @static if VERSION < v"0.6.0-dev.2042"
(allow_retry(retry_on(exec)), retries(exec), Base.DEFAULT_RETRY_MAX_DELAY)
else
(ExponentialBackOff(; n=retries(exec)), allow_retry(retry_on(exec)))
end

f = wrap_on_error(
wrap_retry(
run_inner!,
allow_retry(retry_on(exec)),
retries(exec),
Base.DEFAULT_RETRY_MAX_DELAY
retry_args...,
),
on_error_inner!
)
Expand Down Expand Up @@ -519,5 +531,9 @@ function allow_retry(conditions::Vector{Function})
return ret
end

return inner_allow_retry
@static if VERSION < v"0.6.0-dev.2042"
return inner_allow_retry
else
return (state, e) -> (state, inner_allow_retry(e))
end
end
6 changes: 3 additions & 3 deletions src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function process_nodes!(ex::Expr, ctx_sym::Symbol)
elseif ex.head === :dispatchinclude
process_include!(ex, ctx_sym)
else
map!(x->process_nodes!(x, ctx_sym), ex.args)
map!(x->process_nodes!(x, ctx_sym), ex.args, ex.args)
end

return ex
Expand All @@ -147,7 +147,7 @@ function process_op!(ex::Expr, ctx_sym::Symbol)
Expr(
:call,
Dispatcher.Op,
map!(x->process_nodes!(x, ctx_sym), fn_call_expr.args)...
map!(x->process_nodes!(x, ctx_sym), fn_call_expr.args, fn_call_expr.args)...
)
]
end
Expand All @@ -167,7 +167,7 @@ function process_include!(ex::Expr, ctx_sym::Symbol)
insert!(fn_call_expr.args, 2, ctx_sym)

ex.head = fn_call_expr.head
ex.args = map!(x->process_nodes!(x, ctx_sym), fn_call_expr.args)
ex.args = map!(x->process_nodes!(x, ctx_sym), fn_call_expr.args, fn_call_expr.args)

ex
end
2 changes: 1 addition & 1 deletion src/nodes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ the [`dependencies`](@ref) function.
"""
abstract DispatchNode <: DeferredFutures.AbstractRemoteRef

typealias DispatchResult Result{DispatchNode, DependencyError}
const DispatchResult = Result{DispatchNode, DependencyError}

"""
has_label(node::DispatchNode) -> Bool
Expand Down

0 comments on commit 7fd7e38

Please sign in to comment.