hero.baobab.actor #
fn new #
fn new(name string) Actor
fn new_client #
fn new_client(config ClientConfig) !Client
fn new_openapi_proxy #
fn new_openapi_proxy(proxy OpenAPIProxy) OpenAPIProxy
creates and OpenAPI Proxy Controller
fn new_server #
fn new_server(cfg ServerConfig) !&Server
interface IActor #
interface IActor {
name string
mut:
handle(string, string) !string
}
fn (IActor) run #
fn (mut actor IActor) run() !
Actor listens to the Redis queue for method invocations
struct Actor #
struct Actor {
pub:
name string
}
struct Client #
struct Client {
pub mut:
rpc redisclient.RedisRpc // Redis RPC mechanism
}
Processor struct for managing procedure calls
fn (Client) monologue #
fn (mut p Client) monologue(call ProcedureCall, params Params) !
Process the procedure call
fn (Client) call_to_action #
fn (mut p Client) call_to_action(action Procedure, params Params) !ProcedureResponse
Process the procedure call
struct ClientConfig #
struct ClientConfig {
pub:
redis_url string // url to redis server running
redis_queue string // name of redis queue
}
struct Context #
struct Context {
veb.Context
}
struct Handler #
struct Handler {
pub mut:
client Client
}
struct OpenAPIProxy #
struct OpenAPIProxy {
client Client
specification OpenAPI
}
fn (OpenAPIProxy) controller #
fn (proxy OpenAPIProxy) controller() &Controller
creates and OpenAPI Proxy Controller
struct Params #
@[params]
struct Params {
pub:
timeout int // Timeout in seconds
}
Parameters for processing a procedure call
struct RunParams #
@[params]
struct RunParams {
pub:
port int = 8080
}
struct Server #
struct Server {
veb.Controller
}
fn (Server) run #
fn (mut server Server) run(params RunParams)
struct ServerConfig #
struct ServerConfig {
ClientConfig
pub:
openapi_spec OpenAPI
}