Genie’s public methods of programme management
genie
methods
#
engee.genie.start
— Function
engee.genie.start(app_path::String; devel::Bool=false, log_file::String="")
Launches the Genie application at the specified path.
Before using the engee.genie.start
command, make sure that if the application is a directory, it contains a file with the application code and the .jl extension. Also remove the config and *.toml files (if present).
Arguments
-
app_path::String
: path to the application directory. Can be relative or absolute. -
devel::Bool=false
: parameter to enable development mode, where code changes are applied without restarting the application. -
log_file::String=""
: parameter to specify the path to the log file. If not specified, the logs are not saved separately.
Examples
# Запуск Genie через файл приложения app.jl, без режима разработки и сохранения логов
engee.genie.start("/user/app.jl")
# Запуск Genie через файл приложения app.jl, с режимом разработки и сохранением логов
engee.genie.start("/user/app.jl", devel=true, log_file="/user/logs.txt")
#
engee.genie.stop
— Function
engee.genie.stop(app_path::String)
Stops the running Genie application.
Arguments
app_path::String
: path to the application directory. Can be relative or absolute.
Examples
# Остановка приложения по абсолютному пути
engee.genie.stop("/user/app.jl")
# Остановка приложения по относительному пути
engee.genie.stop("app.jl")
#
engee.genie.list
— Function
engee.genie.list()
Displays a list of all running Genie applications.
Examples
engee.genie.list()
#
engee.genie.eval
— Function
engee.genie.eval(code::AbstractString)
Executes the specified code in Engee workspace outside the context of a running Genie application. Use to run individual expressions, debug or dynamically execute code without having to restart the application.
Arguments
code::AbstractString
: string with the code on Julia to be executed in the Engee workspace.
Examples
engee.genie.eval("x = 5")
#
engee.genie.recv
— Function
engee.genie.recv(wsVarName::AbstractString; context::Module=GenieAPI )
Returns the value of a variable from the specified context (module) in the Engee workspace at runtime of the Genie application.
By default, the variable is looked up in the module GenieAPI
, but if necessary, you can explicitly specify another module via the parameter context
. Thus, if the variable is defined in another module, the parameter context
is used to specify in which namespace to look for it.
Arguments
-
wsVarName::AbstractString
: the name of the variable whose value is to be retrieved. -
context::Module=GenieAPI
: the module in which the variable is searched. Specified explicitly if the variable does not belong to moduleGenieAPI
.
Examples
# Получение значения переменной x из модуля Main
engee.genie.recv("x", Main)
# Получение значения переменной a из модуля по умолчанию
engee.genie.recv("a")
# Получение значения переменной value из пользовательского модуля
engee.genie.recv("value"; context=MyModule)
#
engee.genie.send
— Function
engee.genie.send(wsVarName::AbstractString, value::Any)
Saves the value of value
to the wsVarName
variable in the Engee workspace while the application is running on Genie.
If a variable with this name did not exist before, it will be created automatically. The function is useful for passing intermediate results or user data from the Genie application to a Engee session.
Arguments
-
wsVarName::AbstractString
: the name of the variable to which the value is assigned. -
value::Any
: the value to be stored in the variable. Can be of any type.
Examples
# Присвоение переменной x значение 124
engee.genie.send("x", 124)
# Сохранение строки в переменной message
engee.genie.send("message", "Hello")