Platform
ScaiWave ScaiGrid ScaiCore ScaiBot ScaiDrive ScaiKey Models Tools & Services
Solutions
Organisations Developers Internet Service Providers Managed Service Providers AI-in-a-Box
Resources
Support Documentation Blog Downloads
Company
About Research Careers Investment Opportunities Contact
Log in

Statements

Statement Syntax Context
Assignment x = expression Everywhere
Return return expression Flows, transformers, evaluators
Yield yield expression @parallel, @foreach
Break break @while, @foreach
Continue continue @while, @foreach
If/Else if cond { ... } else { ... } Inside blocks
Match match expr { pattern => expr } Everywhere
Emit emit event_name { fields } Inside flows

8.1 emit — Fire Event#

Emits an asynchronous event. Fire-and-forget — does not wait for delivery. Any Core subscribed via @on will receive the event.

scaicore
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
// Emit a simple event
emit invoice_processed {
    invoice_id = result.invoice_id
    vendor = result.vendor
    total = result.total
    processed_at = now()
}

// Emit conditionally
if escalated {
    emit escalation_triggered {
        customer_id = customer.id
        reason = escalation_reason
        severity = :high
    }
}

Properties:

  • Fire-and-forget (no return value, no delivery confirmation)
  • At-least-once delivery (events may be delivered more than once)
  • Per-source ordering (events from same Core arrive in order)
  • Transport handled by Host's EventBus implementation

Updated 2026-05-17 08:59:18 View source (.md) rev 1