Introspection
ConanJs gives you the ability to check on its internal status so that you can leverage this information for common use cases. For instance:
- You can check if there are operations running at the moment, and wait for them to finish, very handy for testing.
These are the different statuses in the meta flow:
- starting. The Conan State is starting
- init. The Conan State has started and reached the first initial state.
- running. The Conan State is running at least one action (sync or async)
- idle. The Conan State is started but is not running anything at the moment.
- idleOnTransaction. Similar, but on a transaction, while on a transaction, the idle status only is reached when the transaction is closed. This is very handy for testing
- error An error has occurred
- lastError: The last error raised
- transactionCount: The count of transactions opened at the moment.
- status: One of
export enum MetaStatus {
STARTING = 'STARTING',
INIT = "INIT",
RUNNING = "RUNNING",
ERROR = "ERROR",
IDLE = "IDLE",
IDLE_ON_TRANSACTION = "IDLE_ON_TRANSACTION",
}
numberValue$.openTransaction(`test-transaction`)