RuleBasedIoRouter

public class RuleBasedIoRouter : IoRouter

Supports rule-based routing of data from IO sources to IO actors based on an associated IO context.

Define rules that determine whether a given pair of IO source and IO actor should be associated or not. A rule is only applied if the value type of IO source and IO actor are compatible. If no rules are defined or no rule matches no associations between IO sources and IO actors are established.

You can define global rules that match IO sources and actors of any compatible value type or value-type specific rules that are only applied to IO sources and IO actors with a given value type.

By default, an IO source and an IO actor are compatible if both define equal value types in equal data formats. You can define your own custom compatibility check on value types in a subclass by overriding the areValueTypesCompatible method.

Note that this router makes its IO context available by advertising and for discovery (by core type, object type, or object Id) and listens for Update-Complete events on its IO context, triggering onIoContextChanged automatically.

This router requires the following controller options:

  • ioContext: the IO context for which this router is managing routes (mandatory)
  • rules: an array of rule definitions for this router. The rules listed here override any rules defined in the onInit method.

Overridden lifecycle methods.

  • Declaration

    Swift

    public override func onInit()