Comments (4)
Thank you for your interest. I am going to add the REST API, these days I am a bit busy with the starting of second semester, but I hope to do it for next week.
from daemonmode.jl.
Thank you for the suggestion. I copy the idea. I had chosen the socket option because it is in the standard library, but actually rest api could be simpler. After making possible that the server and the client are in different computers, I will add it.
from daemonmode.jl.
This would be extremely useful. Is it implemented already? didn't see it described in the readme.
from daemonmode.jl.
I created a basic Genie app to try and do this: https://github.com/NightMachinary/RestingDemon
The file https://github.com/NightMachinary/RestingDemon/blob/master/routes.jl is where the logic should be defined:
using Genie, Genie.Router, Genie.Requests, Genie.Renderer.Json
using DaemonMode
route("/jsonpayload", method = POST) do
@show jsonpayload()
out = runexpr(jsonpayload()["code"])
json(out)
end
The problem is that I need runexpr
to return stdout
, stderr
, and the resulting Julia object to me, so that I can put them in the JSON response; But runexpr
just dumps stdout
(etc) to the Genie app's stdout
, and doesn't return anything.
Using
route("/jsonpayload", method = POST) do
@show jsonpayload()
code = jsonpayload()["code"]
out = eval(Meta.parse(code))
json(out)
end
I can at least do the easiest stuff:
❯ echo '{"code": "1+(8*4)"}' | curl --fail --silent --location --header "Content-Type: application/json" --request POST --data '@-' localhost:8000/jsonpayload
33
from daemonmode.jl.
Related Issues (20)
- eval() does not work with DaemonMode? HOT 3
- Version 0.1.10 HOT 1
- Different output from DaemonMode when compared to native julia HOT 1
- Add SIGINT handler? HOT 1
- Error running scripts calling `@info` HOT 1
- support unix domain sockets (instead of port number) HOT 2
- Output from "display()" does not exist
- Integrating DaemonMode into Julia-vscode extension (or something similar) HOT 1
- MethodError runargs
- ERROR: LoadError: IOError: could not spawn setenv(...) operation not supported on socket (ENOTSUP) HOT 5
- Poor timing on print
- Is it possible builtin this daemon mode in official julia
- Handle `-e` / `-E` arguments. HOT 1
- "DaemonMode::end" emitted when built into a sysimage HOT 2
- exit() exits the server HOT 12
- got unsupported keyword argument "async" HOT 1
- Revise does not gracefully fail
- DaemonMode performs no multiprocessing HOT 1
- DaemonMode multiprocessing without performance increase? HOT 2
- ARGS are not parse correctly with quotation marks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daemonmode.jl.