JuliaWeb / JuliaWeb/JuliaWebAPI.jl
Ability to add endpoints and redefine functions without restarting
- Dominant language
- Julia
- Stars
- 189
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
First, I ran the process async. Then, I want to either a new function but it came back with the world age issue.
```
julia> apiresponder = APIResponder("tcp://0.0.0.0:8890")
JuliaWebAPI.APIResponder with endpoints:
julia> function testfn1(arg1, arg2; narg1="1", narg2="2")
return (parse(Int, arg1) * parse(Int, narg1)) + (parse(Int, arg2) * parse(Int, narg2))
end
testfn1 (generic function with 1 method)
julia> register(apiresponder, testfn1)
JuliaWebAPI.APIResponder with endpoints:
"testfn1"
julia> process(apiresponder; async=true)
JuliaWebAPI.APIResponder with endpoints:
"testfn1"
```
Now, add and register a new function:
```
julia> testfn4(arg1, arg2) = test1(args1, args2)
testfn4 (generic function with 1 method)
julia> register(apiresponder, testfn4)
JuliaWebAPI.APIResponder with endpoints:
"testfn1", "testfn4"
```
Hit the `testfn4` url and got this exception:
```
julia> 29-Mar 23:40:30:ERROR:root:api_exception: MethodError: no method matching testfn4(::String, ::String)
The applicable method may be too new: running in world age 21847, while current world is 21848.
Closest candidates are:
testfn4(::Any, ::Any) at REPL[7]:1 (method too new to be called from this world context.)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.