Core¶
tangram_core
¶
InjectBackendState
module-attribute
¶
InjectBackendState: TypeAlias = Annotated[BackendState, Depends(get_state)]
BackendState
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/backend.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
loaded_plugins
class-attribute
instance-attribute
¶
Activated plugins keyed by runtime plugin ID.
Runtime
¶
Manages the lifecycle of the Tangram backend, including the Uvicorn server, background services, and connection pools (Redis, HTTPX).
Source code in packages/tangram_core/src/tangram_core/backend.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | |
start
async
¶
start() -> Self
Starts the backend runtime.
Source code in packages/tangram_core/src/tangram_core/backend.py
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | |
wait
async
¶
wait() -> None
Waits for the server task to complete (e.g. via signal or internal error).
Source code in packages/tangram_core/src/tangram_core/backend.py
517 518 519 520 521 522 523 | |
stop
async
¶
stop() -> None
Stops the backend runtime.
Source code in packages/tangram_core/src/tangram_core/backend.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 | |
Config
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
server
class-attribute
instance-attribute
¶
server: ServerConfig = field(default_factory=ServerConfig)
channel
class-attribute
instance-attribute
¶
channel: ChannelConfig = field(default_factory=ChannelConfig)
plugins
class-attribute
instance-attribute
¶
Mapping of runtime plugin ID to plugin-specific config.
from_file
classmethod
¶
from_file(config_path: StrOrPathLike) -> Config
Source code in packages/tangram_core/src/tangram_core/config.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
Plugin
dataclass
¶
Stores the metadata and registered API routes, background services and frontend assets for a tangram plugin.
Packages should declare an entry point in the tangram_core.plugins group
in their pyproject.toml pointing to an instance of this class.
Source code in packages/tangram_core/src/tangram_core/plugin.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
frontend_path
class-attribute
instance-attribute
¶
frontend_path: str | None = None
Path to the compiled frontend assets, relative to the distribution root (editable) or package root (wheel).
config_class
class-attribute
instance-attribute
¶
config_class: type | None = None
The backend configuration class (dataclass, TypedDict or Pydantic model) for the plugin.
frontend_config_class
class-attribute
instance-attribute
¶
frontend_config_class: type | None = None
The frontend configuration class for the plugin. If set, it will be used to generate the frontend schema and validate settings updates. Fields should be annotated with tangram_core.config.FrontendMutable if they are allowed to be modified from the frontend settings UI.
into_frontend_config_function
class-attribute
instance-attribute
¶
into_frontend_config_function: IntoFrontendConfigFunction | None = None
Function to transform the backend configuration into the frontend
configuration. It receives the validated backend configuration object and
should return an instance of frontend_config_class.
Useful if the user wants to hide sensitive fields (e.g. API keys) from the frontend
or dynamically compute certain fields.
Required if frontend_config_class is set.
lifespan
class-attribute
instance-attribute
¶
lifespan: Lifespan | None = None
Async context manager for plugin initialization and teardown.
services
class-attribute
instance-attribute
¶
get_typer
class-attribute
instance-attribute
¶
get_typer: Callable[[], Typer] | None = None
A function that returns the subcommands which will later be registered.
id
class-attribute
instance-attribute
¶
Runtime plugin ID, populated from the entry-point name during loading.
dist_name
class-attribute
instance-attribute
¶
dist_name: DistributionName = field(init=False)
Python distribution name that provided this plugin, populated during loading.
This is package metadata only. Runtime registration, configuration,
frontend URLs, and ownership use id.
module_name
class-attribute
instance-attribute
¶
module_name: ModuleName = field(init=False, repr=False)
Python import module referenced by the plugin entry point.
register_service
¶
register_service(priority: Priority = 0) -> Callable[[ServiceFunc], ServiceFunc]
Decorator to register a background service function.
Services are long-running async functions that receive the BackendState and are started when the application launches.
Source code in packages/tangram_core/src/tangram_core/plugin.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
adapter
¶
adapter() -> TypeAdapter[Any] | None
Returns a cached Pydantic TypeAdapter for the plugin's configuration class.
Avoids expensive rebuilds on every validation request, such as those from the settings UI.
Source code in packages/tangram_core/src/tangram_core/plugin.py
119 120 121 122 123 124 125 | |
frontend_adapter
¶
frontend_adapter() -> TypeAdapter[Any] | None
Returns a cached Pydantic TypeAdapter for the plugin's frontend configuration class.
Source code in packages/tangram_core/src/tangram_core/plugin.py
135 136 137 138 | |
backend
¶
InjectBackendState
module-attribute
¶
InjectBackendState: TypeAlias = Annotated[BackendState, Depends(get_state)]
DEFAULT_THEMES
module-attribute
¶
DEFAULT_THEMES = (ThemeDefinition(name='light', background='#ffffff', foreground='#000000', surface='#f8f9fa', border='#e7e7e7', hover='#e9ecef', accent1='oklch(0.5616 0.0895 251.64)', accent1_foreground='#ffffff', accent2='oklch(0.8021 0.11 92.43)', accent2_foreground='#000000', muted='#666666', error='#8e1b27'), ThemeDefinition(name='dark', background='#1a1a1a', foreground='#e0e0e0', surface='#2d2d2d', border='#404040', hover='#343434', accent1='oklch(0.5059 0.0895 251.64)', accent1_foreground='#ffffff', accent2='oklch(0.5059 0.0895 93.53)', accent2_foreground='#ffffff', muted='#999999', error='#844d53'))
BackendState
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/backend.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |
loaded_plugins
class-attribute
instance-attribute
¶
Activated plugins keyed by runtime plugin ID.
Runtime
¶
Manages the lifecycle of the Tangram backend, including the Uvicorn server, background services, and connection pools (Redis, HTTPX).
Source code in packages/tangram_core/src/tangram_core/backend.py
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | |
start
async
¶
start() -> Self
Starts the backend runtime.
Source code in packages/tangram_core/src/tangram_core/backend.py
468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | |
wait
async
¶
wait() -> None
Waits for the server task to complete (e.g. via signal or internal error).
Source code in packages/tangram_core/src/tangram_core/backend.py
517 518 519 520 521 522 523 | |
stop
async
¶
stop() -> None
Stops the backend runtime.
Source code in packages/tangram_core/src/tangram_core/backend.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 | |
get_state
async
¶
get_state(request: Request) -> BackendState
Source code in packages/tangram_core/src/tangram_core/backend.py
74 75 | |
get_distribution_path
¶
get_distribution_path(dist_name: DistributionName, module_name: ModuleName) -> Path
Get a distribution's source root or installed import-package root.
Editable installs resolve to the project directory from direct_url.json.
Installed distributions resolve from their metadata, optionally using an
entry-point module to disambiguate distributions.
See: https://packaging.python.org/en/latest/specifications/direct-url-data-structure/
Source code in packages/tangram_core/src/tangram_core/backend.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
resolve_frontend
¶
Source code in packages/tangram_core/src/tangram_core/backend.py
134 135 136 137 138 139 140 | |
load_enabled_plugins
¶
Source code in packages/tangram_core/src/tangram_core/backend.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 | |
lifespan
async
¶
lifespan(app: FastAPI, backend_state: BackendState, loaded_plugins: Iterable[Plugin]) -> AsyncGenerator[None, None]
Source code in packages/tangram_core/src/tangram_core/backend.py
159 160 161 162 163 164 165 166 167 168 169 170 | |
default_cache_dir
¶
default_cache_dir() -> Path
Source code in packages/tangram_core/src/tangram_core/backend.py
173 174 175 176 177 178 179 180 181 | |
make_cache_route_handler
¶
make_cache_route_handler(entry: CacheEntry, state: BackendState) -> Callable[..., Awaitable[FileResponse]]
Factory function that creates a route handler for caching and serving files. Dynamically handles URL parameters found in both serve_route and origin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entry
|
CacheEntry
|
Cache entry configuration |
required |
state
|
BackendState
|
Backend state with http_client for fetching remote resources |
required |
Returns:
| Type | Description |
|---|---|
Callable[..., Awaitable[FileResponse]]
|
Async function that handles the route with dynamic parameters |
Source code in packages/tangram_core/src/tangram_core/backend.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 | |
core_into_frontend_config
¶
core_into_frontend_config(config: Config) -> FrontendConfig
Source code in packages/tangram_core/src/tangram_core/backend.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | |
create_app
¶
create_app(backend_state: BackendState, loaded_plugins: Iterable[Plugin]) -> FastAPI
Source code in packages/tangram_core/src/tangram_core/backend.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | |
run_channel_service
async
¶
run_channel_service(config: Config) -> None
Source code in packages/tangram_core/src/tangram_core/backend.py
430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
get_log_config_dict
¶
Source code in packages/tangram_core/src/tangram_core/backend.py
553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 | |
config
¶
HasTopbarUiConfig
¶
HasSidebarUiConfig
¶
ServerConfig
dataclass
¶
ChannelConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
65 66 67 68 69 70 71 72 73 74 | |
MapConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | |
style
class-attribute
instance-attribute
¶
style: Annotated[MapStyle, FrontendMutable(widget='map-settings')] = 'https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json'
styles
class-attribute
instance-attribute
¶
styles: Annotated[list[MapStyle], FrontendMutable(widget='map-settings')] = field(default_factory=list)
center_lat
class-attribute
instance-attribute
¶
center_lat: Annotated[float, Ge(-90), Le(90), FrontendMutable()] = 48.0
center_lon
class-attribute
instance-attribute
¶
center_lon: Annotated[float, Ge(-180), Le(180), FrontendMutable()] = 7.0
zoom
class-attribute
instance-attribute
¶
zoom: Annotated[float, Ge(0), Le(24), FrontendMutable()] = 4
pitch
class-attribute
instance-attribute
¶
pitch: Annotated[float, Ge(0), Le(85), FrontendMutable()] = 0
bearing
class-attribute
instance-attribute
¶
bearing: Annotated[float, Ge(-180), Le(180), FrontendMutable()] = 0
min_zoom
class-attribute
instance-attribute
¶
min_zoom: Annotated[float, Ge(0), Le(24), FrontendMutable()] = 0
max_zoom
class-attribute
instance-attribute
¶
max_zoom: Annotated[float, Ge(0), Le(24), FrontendMutable()] = 24
max_pitch
class-attribute
instance-attribute
¶
max_pitch: Annotated[float, Ge(0), Le(85), FrontendMutable()] = 70
allow_pitch
class-attribute
instance-attribute
¶
allow_pitch: Annotated[bool, FrontendMutable()] = True
allow_bearing
class-attribute
instance-attribute
¶
allow_bearing: Annotated[bool, FrontendMutable()] = True
ThemeDefinition
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
accent1_foreground
instance-attribute
¶
accent1_foreground: Annotated[str, FrontendMutable(kind='color')]
accent2_foreground
instance-attribute
¶
accent2_foreground: Annotated[str, FrontendMutable(kind='color')]
AdaptiveTheme
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
183 184 185 186 | |
CoreConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
189 190 191 192 193 194 195 196 197 198 199 | |
theme
class-attribute
instance-attribute
¶
theme: Annotated[str | AdaptiveTheme, FrontendMutable(widget='theme-settings')] = field(default_factory=AdaptiveTheme)
themes
class-attribute
instance-attribute
¶
themes: Annotated[list[ThemeDefinition], FrontendMutable(widget='theme-settings')] = field(default_factory=list)
CacheEntry
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
202 203 204 205 206 207 208 209 210 211 | |
origin
class-attribute
instance-attribute
¶
origin: str | None = None
Origin URL. If None, the local file is served directly.
local_path
class-attribute
instance-attribute
¶
local_path: Path | None = None
Local path to cache the file.
CacheConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
214 215 216 | |
entries
class-attribute
instance-attribute
¶
entries: list[CacheEntry] = field(default_factory=list)
Config
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
server
class-attribute
instance-attribute
¶
server: ServerConfig = field(default_factory=ServerConfig)
channel
class-attribute
instance-attribute
¶
channel: ChannelConfig = field(default_factory=ChannelConfig)
plugins
class-attribute
instance-attribute
¶
Mapping of runtime plugin ID to plugin-specific config.
from_file
classmethod
¶
from_file(config_path: StrOrPathLike) -> Config
Source code in packages/tangram_core/src/tangram_core/config.py
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | |
FrontendCoreConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
281 282 283 284 285 286 287 288 | |
theme
class-attribute
instance-attribute
¶
theme: Annotated[str | AdaptiveTheme, FrontendMutable(widget='theme-settings')] = field(default_factory=AdaptiveTheme)
themes
class-attribute
instance-attribute
¶
themes: Annotated[list[ThemeDefinition], FrontendMutable(widget='theme-settings')] = field(default_factory=list)
FrontendChannelConfig
dataclass
¶
FrontendConfig
dataclass
¶
Source code in packages/tangram_core/src/tangram_core/config.py
296 297 298 299 300 | |
FrontendMutable
dataclass
¶
Marker to allow a particular field in a frontend configuration to be mutated in the settings page.
Source code in packages/tangram_core/src/tangram_core/config.py
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | |
FrontendData
¶
Bases: TypedDict
Source code in packages/tangram_core/src/tangram_core/config.py
332 333 334 | |
default_config_file
¶
default_config_file() -> Path
Source code in packages/tangram_core/src/tangram_core/config.py
36 37 38 39 40 41 42 43 44 45 46 | |
get_default_asset
¶
get_default_asset(*parts: str) -> Traversable
Source code in packages/tangram_core/src/tangram_core/config.py
83 84 85 86 87 | |
load_built_in_style
¶
load_built_in_style(filename: str) -> StyleSpecification
Source code in packages/tangram_core/src/tangram_core/config.py
90 91 92 93 94 | |
default_styles
¶
Source code in packages/tangram_core/src/tangram_core/config.py
97 98 99 100 101 102 103 | |
style_identifier
¶
style_identifier(style: StyleSpecification, key: str) -> str | None
Source code in packages/tangram_core/src/tangram_core/config.py
106 107 108 | |
styles_match
¶
Source code in packages/tangram_core/src/tangram_core/config.py
111 112 113 114 115 116 117 118 119 120 | |
merge_styles
¶
Source code in packages/tangram_core/src/tangram_core/config.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
try_resolve_local_style
¶
Source code in packages/tangram_core/src/tangram_core/config.py
262 263 264 265 266 267 268 269 270 271 | |
to_frontend_manifest
¶
to_frontend_manifest(adapter: TypeAdapter[Any], frontend_cfg: Any) -> FrontendData
Serialises a frontend configuration.
Source code in packages/tangram_core/src/tangram_core/config.py
337 338 339 340 341 | |
parse_frontend_config
¶
Deserialises and validates frontend-submitted config data.
Source code in packages/tangram_core/src/tangram_core/config.py
344 345 346 | |
plugin
¶
ServiceAsyncFunc
module-attribute
¶
ServiceFunc
module-attribute
¶
ServiceFunc: TypeAlias = ServiceAsyncFunc | Callable[[BackendState], None]
IntoFrontendConfigFunction
module-attribute
¶
Lifespan
module-attribute
¶
Lifespan: TypeAlias = Callable[[BackendState], AbstractAsyncContextManager[None, bool | None]]
Plugin
dataclass
¶
Stores the metadata and registered API routes, background services and frontend assets for a tangram plugin.
Packages should declare an entry point in the tangram_core.plugins group
in their pyproject.toml pointing to an instance of this class.
Source code in packages/tangram_core/src/tangram_core/plugin.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
frontend_path
class-attribute
instance-attribute
¶
frontend_path: str | None = None
Path to the compiled frontend assets, relative to the distribution root (editable) or package root (wheel).
config_class
class-attribute
instance-attribute
¶
config_class: type | None = None
The backend configuration class (dataclass, TypedDict or Pydantic model) for the plugin.
frontend_config_class
class-attribute
instance-attribute
¶
frontend_config_class: type | None = None
The frontend configuration class for the plugin. If set, it will be used to generate the frontend schema and validate settings updates. Fields should be annotated with tangram_core.config.FrontendMutable if they are allowed to be modified from the frontend settings UI.
into_frontend_config_function
class-attribute
instance-attribute
¶
into_frontend_config_function: IntoFrontendConfigFunction | None = None
Function to transform the backend configuration into the frontend
configuration. It receives the validated backend configuration object and
should return an instance of frontend_config_class.
Useful if the user wants to hide sensitive fields (e.g. API keys) from the frontend
or dynamically compute certain fields.
Required if frontend_config_class is set.
lifespan
class-attribute
instance-attribute
¶
lifespan: Lifespan | None = None
Async context manager for plugin initialization and teardown.
services
class-attribute
instance-attribute
¶
get_typer
class-attribute
instance-attribute
¶
get_typer: Callable[[], Typer] | None = None
A function that returns the subcommands which will later be registered.
id
class-attribute
instance-attribute
¶
Runtime plugin ID, populated from the entry-point name during loading.
dist_name
class-attribute
instance-attribute
¶
dist_name: DistributionName = field(init=False)
Python distribution name that provided this plugin, populated during loading.
This is package metadata only. Runtime registration, configuration,
frontend URLs, and ownership use id.
module_name
class-attribute
instance-attribute
¶
module_name: ModuleName = field(init=False, repr=False)
Python import module referenced by the plugin entry point.
register_service
¶
register_service(priority: Priority = 0) -> Callable[[ServiceFunc], ServiceFunc]
Decorator to register a background service function.
Services are long-running async functions that receive the BackendState and are started when the application launches.
Source code in packages/tangram_core/src/tangram_core/plugin.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
adapter
¶
adapter() -> TypeAdapter[Any] | None
Returns a cached Pydantic TypeAdapter for the plugin's configuration class.
Avoids expensive rebuilds on every validation request, such as those from the settings UI.
Source code in packages/tangram_core/src/tangram_core/plugin.py
119 120 121 122 123 124 125 | |
frontend_adapter
¶
frontend_adapter() -> TypeAdapter[Any] | None
Returns a cached Pydantic TypeAdapter for the plugin's frontend configuration class.
Source code in packages/tangram_core/src/tangram_core/plugin.py
135 136 137 138 | |
scan_plugins
¶
scan_plugins() -> EntryPoints
Source code in packages/tangram_core/src/tangram_core/plugin.py
141 142 | |
load_plugin
¶
load_plugin(entry_point: EntryPoint) -> Plugin | None
Load a plugin and attach its runtime ID and Python distribution name.
Source code in packages/tangram_core/src/tangram_core/plugin.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 | |
redis
¶
Subscriber
¶
Source code in packages/tangram_core/src/tangram_core/redis.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
subscribe
async
¶
subscribe() -> None
Source code in packages/tangram_core/src/tangram_core/redis.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
cleanup
async
¶
cleanup() -> None
Source code in packages/tangram_core/src/tangram_core/redis.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | |
is_active
¶
is_active() -> bool
Return True if the subscriber is actively listening.
Source code in packages/tangram_core/src/tangram_core/redis.py
81 82 83 | |
message_handler
abstractmethod
async
¶
Source code in packages/tangram_core/src/tangram_core/redis.py
85 86 87 88 89 | |