Skip to content

Commit

Permalink
Merge 1e4f49d into 1d3eca1
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsamaroo committed Oct 23, 2020
2 parents 1d3eca1 + 1e4f49d commit 250d1a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/thunk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ end

# A thing to run
mutable struct Thunk
f::Function
f::Any # usually a Function, but could be any callable
inputs::Tuple
id::Int
get_result::Bool # whether the worker should send the result or only the metadata
Expand Down
11 changes: 11 additions & 0 deletions test/processors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,15 @@ end

wait(rmprocs(ps))
end

@testset "Callable as Thunk function" begin
@everywhere begin
struct ABC end
(::ABC)(x) = x+1
end

abc = ABC()
a = delayed(abc)(1)
@test collect(a) == 2
end
end

0 comments on commit 250d1a7

Please sign in to comment.