space_ex v0.3.0 SpaceEx.Procedure
Represents a remote procedure call, for streams and expressions.
Normally created using the new/4
function or the create/1
macro.
Link to this section Summary
Functions
Creates a procedure structure based on an actual procedure call
Creates a procedure structure, representing a kRPC procedure call
Link to this section Functions
Creates a procedure structure based on an actual procedure call.
You can wrap any normal API function call in this, and it will parse that into a format suitable for using in streams, expressions, etc. For example:
require SpaceEx.Procedure
call1 = SpaceEx.Procedure.create(SpaceEx.SpaceCenter.get_ut(conn))
# You can also use pipelining:
call2 =
SpaceEx.SpaceCenter.Flight.get_mean_altitude(conn, flight)
|> SpaceEx.Procedure.create
create(Mod.func(conn, args))
is equivalent to calling
new(conn, Mod, :func, args)
.
Creates a procedure structure, representing a kRPC procedure call.
conn
— aSpaceEx.Connection
module
— a SpaceEx kRPC module, e.g.SpaceEx.SpaceCenter.Vessel
function
— the function name, as an atom, e.g.:get_max_thrust
args
— the arguments as an array (if any)
Any arguments will be immediately encoded, so most errors related to argument data (e.g. incorrect type) will be detected immediately.