Docs Annotations

Annotations

The four annotations Synapse ships, and the rules each one enforces.

Annotations

Four annotations drive everything. All are runtime annotations on methods of a Node subclass, bound when the node is registered with orchestrator.registerNode(name, node).

AnnotationRepeatableMethod signatureBinds to
@SubscribedToyes0 or 1 parameter, any returntopic subscription (callback pool)
@RunPeriodicallyyesno parameters, any bodyscheduler pool (or hardware thread)
@RunnableActionnono parameters, returns voidaction pool, fired by name
@OnHardwareThreadno— (modifier on @SubscribedTo methods)re-routes the subscriber to the hardware thread

Rules that apply to all four

  • Write the full attribute. @SubscribedTo(topic = "..."), not @SubscribedTo("...") — the annotation has no shorthand value. @RunnableAction("name") is the exception; its only attribute is the value.
  • Methods must not be static. The binder invokes them reflectively on the node instance.
  • Errors in bound methods never crash the robot. They are logged through the orchestrator’s sink and the next invocation proceeds.
  • Structural violations throw at registerNode time, not at runtime — a wrong parameter count or return type fails the OpMode during init, where it is visible on the Driver Station.

Next steps

Each annotation’s page covers its attributes, runtime behavior, and gotchas.