Skip to content
CI edited this page Feb 17, 2026 · 1 revision

Integration.RegisterErrorHandler(moduleName, handler)

Register an error handler for a specific module.

Args:

  • moduleName - the module name (string)
  • handler - error handler function (function)

Integration.HandleError(moduleName, error, context)

Handle an error from a module with recovery attempt.

Args:

  • moduleName - the module where error occurred (string)
  • error - the error message or object (any)
  • context - additional context information (table)

Returns:

  • recovered - whether error was recovered (boolean)

Integration.AttemptRecovery(moduleName, error, context)

Attempt generic error recovery.

Args:

  • moduleName - the module name (string)
  • error - the error (any)
  • context - error context (table)

Returns:

  • recovered - whether recovery succeeded (boolean)

Integration.GetErrorLog()

Get the error log.

Returns:

  • errorLog - array of error entries (table)

Integration.ClearErrorLog()

Clear the error log.


Integration.RegisterEventHandler(event, moduleName, handler)

Register an event handler for a module.

Args:

  • event - the event name (string)
  • moduleName - the module name (string)
  • handler - event handler function (function)

Integration.UnregisterEventHandler(event, moduleName)

Unregister an event handler.

Args:

  • event - the event name (string)
  • moduleName - the module name (string)

Integration.DispatchEvent(event, ...)

Dispatch an event to all registered handlers.

Args:

  • event - the event name (string)
  • ... - event arguments (any)

Returns:

  • handled - number of handlers that processed the event (number)
  • failed - number of handlers that failed (number)

Integration.StartPerformanceTracking(operation)

Start tracking performance for an operation.

Args:

  • operation - the operation name (string)

Returns:

  • trackingId - tracking identifier (number)

Integration.EndPerformanceTracking(trackingId)

End performance tracking for an operation.

Args:

  • trackingId - the tracking identifier (number)

Returns:

  • duration - operation duration in milliseconds (number)

Integration.GetPerformanceMetrics()

Get all performance metrics.

Returns:

  • metrics - table of performance metrics (table)

Integration.OptimizeMemoryUsage()

Optimize memory usage by cleaning up unused resources.

Returns:

  • freed - estimated memory freed in KB (number)

Integration.RegisterModule(moduleName, module)

Register a module with the integration system.

Args:

  • moduleName - the module name (string)
  • module - the module table (table)

Integration.GetModule(moduleName)

Get a registered module.

Args:

  • moduleName - the module name (string)

Returns:

  • module - the module table or nil (table|nil)

Integration.InitializeAllModules()

Initialize all registered modules in proper order.

Returns:

  • initialized - number of modules initialized (number)
  • failed - number of modules that failed (number)

Integration.WireModules()

Wire all modules together with proper event handling.

Returns:

  • success - whether wiring succeeded (boolean)

Integration.Initialize()

Initialize the integration system.

Returns:

  • success - whether initialization succeeded (boolean)

Integration.GetStatus()

Get integration system status.

Returns:

  • status - status information table (table)