Nornir framework help to make your server/client system of RPC.
This framework is these following features.
-
This framework is written in Haxe, so you write some Haxe code when you use it.
-
Provide same types for server and client.
-
Provide templates of procedure.
-
Useful simple server and client library.
These features are composed of different three components. The feature '2' is called "Verdandi", '3' is called "Urd". Another one is called "Skuld" that's for server/client communication.
Example in samples/simple_skuld is good introduction. You go to samples/simple_skuld.
cd samples/simple_skuld
Next step is executing 'verdandi' command.
haxelib run nornir verdandi json/sample.json
'verdandi' command read json file and make classes following an element of 'classes'.
at json/sample.json
{
"classes":{
"nornir.samples": {
"Person": { "name" : "String", "address":"String" },
"People": { "people" : "Array<Person>" },
"MailData": { "sender":"Person", "receiver":"People", "subject":"String", "body":"String" }
}
}
...
}
'urd' command make procedures following elements without 'classes' in json file.
haxelib run nornir urd json/sample.json
at json/sample.json
{
"classes":{
...
},
"server":{
"nornir.samples": {
"MailToAdressee": { "Mail" : "MailData" }
}
},
"client":{
"nornir.samples": {
"MailToMailServer": { "Mail" : "MailData" }
}
}
}
Skuld is not command but a library. For how to use, See TestServer.hx and TestClient.hx.
'norn' command is executing 'verdandi' and 'urd' at once.
haxelib run nornir norn sample.norn
at sample.norn
-j json/sample.json
verdandi
urd
In norn file you specify json file by '-j' and command to want to execute.
Generating receiver classes is not importing automatically, so you write to import reciever classes explicitly in your code.