Skip to content

Startup ordering - #397

Draft
rwb27 wants to merge 3 commits into
mainfrom
startup-ordering
Draft

Startup ordering#397
rwb27 wants to merge 3 commits into
mainfrom
startup-ordering

Conversation

@rwb27

@rwb27 rwb27 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

This PR allows Things to specify that some Thing Slots must be started first. That means the connected Thing will already be running when __enter__ is called on the host Thing. This should make it easier to write code that interacts with other Things on start-up.

The new syntax looks like the example in #388

Things to do before merge:

Closes #388

rwb27 added 3 commits August 5, 2026 20:07
Also, `attributes` is never used. I've merged it with `class_attributes` to reduce pointless duplication.
This commit adds a `start_first` attribute to `lt.thing_slot` and a simple algorithm that
determines the order in which things must be started in order to fulfil those constraints.

It's not guaranteed to work, and will give a helpful error if that happens.
I should probably create a common base class to deduplicate all the `__enter__` code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ordered Initialisation of Thing Slots

1 participant