View Source Ecspanse.Server (ECSpanse v0.8.1)

The server is responsible for managing the internal state of the framework, scheduling and running the Systems, and batching the Events.

The server is started by adding the module that invokes use Ecspanse to the supervision tree.

Info

There is only one server instance running per otp app. Trying to create another setup module that use Ecspanse and adding it to the supervision tree will result in an error.

Summary

Types

Debug server state

Functions

Returns a specification to start this module under a supervisor.

Utility function. Returns all the internal state of the framework: Ecspanse.Server.State.t/0.

Utility function. The server switches to test mode.

Types

@type debug_next_frame() :: {:next_frame, Ecspanse.Server.State.t()}

Debug server state

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec debug() :: Ecspanse.Server.State.t()

Utility function. Returns all the internal state of the framework: Ecspanse.Server.State.t/0.

This can be useful for debugging systems scheduling and events batching.

This function is intended for use only in testing and development environments.

@spec test_server(pid()) :: :ok

Utility function. The server switches to test mode.

At the beginning of each frame, a debug_next_frame/0 tupple message will be sent to the process passed as function argument.

This function is intended for use only in testing and development environments.