Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update links

...

A pico can have as many inbound channels as it needs. See pico-engine NEXT Managing Channels for more information. A pico can only create and delete channels for itself.

...

For example, this KRL code creates a channel when the app_section_collection ruleset is installed into a pico (see the pico-engine NEXT Pico to Pico Subscriptions Lesson for context):

Code Block
ruleset app_section_collection {
  ...
  global {
    ...
    tags = ["app_section_collection"]
    eventPolicy = {
      "allow": [ { "domain": "section", "name": "*" }, ],
      "deny": []
    }
    queryPolicy = {
      "allow": [ { "rid": meta:rid, "name": "*" } ],
      "deny": []
    }
  }
  rule initialize_section_collection_pico {
    select when wrangler ruleset_installed
      where event:attr("rids") >< meta:rid
    if ent:section_collection_pico_eci.isnull() then
      wrangler:createChannel(tags,eventPolicy,queryPolicy) setting(channel)
    fired {
      ent:section_collection_pico_eci := channel{"id"}
      ent:sections := {}
    }
  }
  ...
}

...

For example, wrangler:rulesetMeta(“hello_world”) (which refers to the ruleset shown in the pico-engine NEXT Pico Engine Quickstart page), would return this map:

...

Parameter

Datatype

Description

eci

String

The ECI to send the query to

mod

String

The RID of the ruleset to send the query to

func

String

The name of the function to query

params

Map

The parameters to be passed to the function on the target pico. Given as a map with parameter name as the key and argument as the value.

_host

String

The host of the pico engine being queried.
Note this must include protocol (http:// or https://) being used and port number if not 80.
For example "http://localhost:80803000", which also is the default.

_path

String

The sub path of the url which does not include mod or func.
For example "/sky/cloud/", which also is the default.

_root_url

String

The entire URL except eci, mod , func.
For example, dependent on _host and _path is
"http://localhost:80803000/sky/cloud/", which also is the default. Defaults to meta:host (the pico engine itself).

...