EN
RU
Portals
0.7.0 · dev
0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Toggle main menu visibility
Loading...
Searching...
No Matches
background_options.hpp
1
// Copyright (c) 2026 ttldtor.
2
// SPDX-License-Identifier: BSL-1.0
3
#pragma once
4
5
#include <cstddef>
6
7
namespace
portals
{
8
class
BackgroundExecutor
;
9
11
enum class
BackgroundError
{
12
INVALID_ARGUMENT
,
13
UNAVAILABLE
,
14
CLOSED
,
15
WOULD_BLOCK
,
16
NO_MEMORY
,
17
START_FAILED
,
18
WRONG_THREAD
,
19
LIMIT_EXCEEDED
,
20
CALLBACK_FAILED
21
};
22
24
struct
BackgroundOptions
{
25
std::size_t
workers
{2};
26
std::size_t
pending
{16};
27
std::size_t
storageSlots
{16};
28
std::size_t
storageBytes
{536870912};
29
};
30
}
// namespace portals
portals::BackgroundExecutor
Borrowed host service. A scene never owns, stops or joins this executor. UI integration calls service...
Definition
background.hpp:72
portals
Public Portals API.
Definition
action.hpp:8
portals::ApplicationFailure::CALLBACK_FAILED
@ CALLBACK_FAILED
A non-allocation exception escaped into a runner callback boundary.
Definition
application.hpp:34
portals::ApplicationFailure::NO_MEMORY
@ NO_MEMORY
Allocation failed at a runner exception boundary.
Definition
application.hpp:33
portals::AsyncError::CLOSED
@ CLOSED
Owner, node scope, scheduler or completion endpoint is closed.
Definition
async.hpp:28
portals::AsyncError::WRONG_THREAD
@ WRONG_THREAD
The operation or coroutine frame belongs to another thread.
Definition
async.hpp:27
portals::AsyncError::WOULD_BLOCK
@ WOULD_BLOCK
Active resume, invocation, registration or queue capacity rejects the operation.
Definition
async.hpp:30
portals::AsyncError::INVALID_ARGUMENT
@ INVALID_ARGUMENT
Empty task, callback or immutable data owner, or invalid policy.
Definition
async.hpp:26
portals::BackgroundError
BackgroundError
Executor admission and startup failures; domain errors stay in the result value.
Definition
background_options.hpp:11
portals::BackgroundError::UNAVAILABLE
@ UNAVAILABLE
A hosted session requires a borrowed executor.
Definition
background_options.hpp:13
portals::BackgroundError::LIMIT_EXCEEDED
@ LIMIT_EXCEEDED
A storage request cannot fit its configured aggregate budget.
Definition
background_options.hpp:19
portals::BackgroundError::START_FAILED
@ START_FAILED
A worker thread could not be created.
Definition
background_options.hpp:17
portals::BackgroundOptions
Count bounds, independent of the transitive byte size of inputs and results.
Definition
background_options.hpp:24
portals::BackgroundOptions::storageSlots
std::size_t storageSlots
Light registered-plus-retiring worker cache slots.
Definition
background_options.hpp:27
portals::BackgroundOptions::workers
std::size_t workers
Positive fixed worker count; unpublished results retain these reservations.
Definition
background_options.hpp:25
portals::BackgroundOptions::storageBytes
std::size_t storageBytes
Aggregate resident/build reservation bytes; not per slot.
Definition
background_options.hpp:28
portals::BackgroundOptions::pending
std::size_t pending
Positive pending count, excluding running or unpublished work.
Definition
background_options.hpp:26
include
portals
background_options.hpp