Skip to content

Commit

Permalink
fixup! Implement an interface for Distributed-like libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWrigley committed Dec 28, 2024
1 parent 6d879e4 commit b468b35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LoweredCodeUtils = "3.0.1"
OrderedCollections = "1"
# Exclude Requires-1.1.0 - see https://github.com/JuliaPackaging/Requires.jl/issues/94
Requires = "~1.0, ^1.1.1"
julia = "1.9"
julia = "1.10"

[extras]
CatIndices = "aafaddc9-749c-510e-ac4f-586e18779b91"
Expand Down
12 changes: 8 additions & 4 deletions src/packagedef.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ using Core: CodeInfo
export revise, includet, entr, MethodSummary


# Abstract type to represent a single worker
abstract type AbstractWorker end

# Wrapper struct to indicate a worker belonging to the Distributed stdlib. Other
# libraries should make their own types for Revise to dispatch on.
struct DistributedWorker
# libraries should make their own type that subtypes AbstractWorker for Revise
# to dispatch on.
struct DistributedWorker <: AbstractWorker
id::Int
end

# This is a list of functions that will retrieve a list of workers
const workers_functions = Function[]
const workers_functions = Base.Callable[]

# A distributed worker library wanting to use Revise should register their
# workers() function with this.
Expand Down Expand Up @@ -1314,7 +1318,7 @@ async_steal_repl_backend() = steal_repl_backend()
Define methods on worker `p` that Revise needs in order to perform revisions on `p`.
Revise itself does not need to be running on `p`.
"""
function init_worker(p)
function init_worker(p::AbstractWorker)
remotecall_impl(Core.eval, p, Main, quote
function whichtt(@nospecialize sig)
@static if VERSION v"1.10.0-DEV.873"
Expand Down

0 comments on commit b468b35

Please sign in to comment.