Julia Futures which are initialized when written to
Clone or download
Latest commit 63faf57 Sep 26, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Tightens version conditional Sep 24, 2018
test Fixes macroexpand tests Sep 24, 2018
.gitignore DeferredFutures.jl generated files. Jun 30, 2016
.travis.yml Fix coverage Sep 20, 2018
LICENSE.md DeferredFutures.jl generated files. Jun 30, 2016
README.md Add better `show` methods May 3, 2017
REQUIRE Fixes allocation test Sep 20, 2018
appveyor.yml Updates to work with julia v1.0 Sep 18, 2018



Build Status Build status codecov

A DeferredFuture is like a regular Julia Future, but is initialized when put! is called on it. This means that the data in the DeferredFuture lives with the process the data was created on. The process the DeferredFuture itself lives on never needs to fetch the data to its process. This is useful when there is a lightweight controller process which handles scheduling work on and transferring data between multiple machines.


Use a DeferredFuture as you would a Future.

julia> DeferredFuture()
DeferredFuture at (1,1,1)

julia> DeferredFuture(3)
DeferredFuture at (3,1,2)

You can also use a DeferredChannel as you would a RemoteChannel.

julia> DeferredChannel(()->Channel{Int}(10), 4)
DeferredChannel(#1) at (4,1,3)

julia> DeferredChannel(4)
DeferredChannel(DeferredFutures.#2) at (4,1,4)

julia> DeferredChannel(4, 128; content=Int)
DeferredChannel(DeferredFutures.#2) at (4,1,5)

Note that DeferredChannel() will create a RemoteChannel with RemoteChannel(()->Channel{Any}(1), myid()) by default.

Furthermore, @defer can be used when creating a Future or RemoteChannel to create their deferred counterparts.

julia> @defer Future()
DeferredFuture at (1,1,6)

julia> @defer RemoteChannel(()->Channel{Int}(10))
DeferredChannel(#3) at (1,1,7)

Note that DeferredFuture(n) does not control where the data lives, only where the RemoteChannel which refers to the data lives.


DeferredFutures.jl is provided under the MIT "Expat" License.