FutoIn Executor

Executor is the fundamental part for FutoIn Service application.

It provides:

  1. Service instance registration.
  2. Request and response message validation against Iface spec.
  3. Authentication and authorization processing.
  4. Throughput and concurrency limits per client/group of clients.
  5. Unified additional request information representation.
  6. Maintenance of persistent communication channels from clients.

Original specification can be found at FTN6: FutoIn Executor Concept.

Native API

Native Executor API should never be used by Service code. It is provided only for Service application initialization boilerplate.

The relevant member functions:

  1. AdvancedCCM ccm() - get reference to Invoker CCM, if any
  2. void register( AsyncSteps as, ifacever, impl ) - add interface implementation

    • ifacever must be represented as FutoIn interface identifier and version, separated by colon ”:”
    • impl is object derived from native interface or associative name for lazy loading
  3. void initFromCache( AsyncSteps as )

    • load initialization from cache
  4. void cacheInit( AsyncSteps as )

    • store initialization to cache
  5. void close()

    • Shutdown Executor processing
  6. void limitConf(name, options)

    • Setup configuration of custom limit
    • name - custom limit name
    • options - AsyncSteps Limiter options
  7. void addressLimitMap(map)

    • Configure static address to custom limit mapping
    • map - custom limit name to list of CIDR addresses

Request throttling

For general stability and fair use, compliant Executor implementation should throttle API requests based on source address at least. Additional limits may be imposed per user ID.

Please check AsyncSteps Limiter to better understand the logic of throttling.

The limits are configured per “limit zone” type. The limit zone is created based on source address to limit zone type map. Source address can support CIDR-like network mask to better protect from DDoS attacks.

The pre-defined limit zone types are:

  • “default”

    • concurrent=8 - maximum active requests at any single time
    • max_queue=32 - pending requests
    • rate=10 - requests per period
    • period_ms=1000 - period of one second
    • burst=null - unlimited (max concurrent by fact)
  • “unlimited”

    • concurrent=int_max
    • max_queue=null
    • rate=int_max
    • period_ms=1000
    • burst=null

Custom limits can be configured through Executor#limitConf(). Request limit zone can be configured for address or range of addresses trough Executor#addressLimitMap().