Skip to content

Commit 3c14a49

Browse files
committed
Deprecate delayed
1 parent f7ae327 commit 3c14a49

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

docs/src/api-dagger/functions.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Pages = ["functions.md"]
1111
```@docs
1212
@spawn
1313
spawn
14-
delayed
15-
@par
1614
```
1715

1816
## Task Options Functions/Macros
@@ -38,16 +36,6 @@ scope
3836
constrain
3937
```
4038

41-
## Lazy Task Functions
42-
```@docs
43-
domain
44-
compute
45-
dependents
46-
noffspring
47-
order
48-
treereduce
49-
```
50-
5139
## Processor Functions
5240
```@docs
5341
execute!

src/sch/eager.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function init_eager()
2424
sopts = SchedulerOptions(;allow_errors=true)
2525
opts = Dagger.Options((;scope=Dagger.ExactScope(Dagger.ThreadProc(1, 1)),
2626
occupancy=Dict(Dagger.ThreadProc=>0)))
27-
Dagger.compute(ctx, Dagger.delayed(eager_thunk, opts)();
27+
Dagger.compute(ctx, Dagger._delayed(eager_thunk, opts)();
2828
options=sopts)
2929
catch err
3030
# Scheduler halting is considered normal

src/thunk.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,13 @@ Creates a [`Thunk`](@ref) object which can be executed later, which will call
171171
`f` with `args` and `kwargs`. `options` controls various properties of the
172172
resulting `Thunk`.
173173
"""
174-
function delayed(f, options::Options)
174+
function _delayed(f, options::Options)
175175
(args...; kwargs...) -> Thunk(f, args_kwargs_to_pairs(args, kwargs)...; options.options...)
176176
end
177+
function delayed(f, options::Options)
178+
Base.depwarn("`delayed` is deprecated. Use `Dagger.@spawn` or `Dagger.spawn` instead.", :delayed; force=true)
179+
return _delayed(f, options)
180+
end
177181
delayed(f; kwargs...) = delayed(f, Options(;kwargs...))
178182

179183
"A weak reference to a `Thunk`."

0 commit comments

Comments
 (0)