Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usam rfc draft #2858

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

usam rfc draft #2858

wants to merge 4 commits into from

Conversation


There will be a `.beamable` folder in the root of the Unity project. Inside the folder, there is a `beamoLocalManifest.json` file that contains details about the availalable Microservices in a project. Also, there is a `config-defaults.json` file that contains the connection strings required to start a Microservice.

Unity will make sure these files are up to date by scanning assets in the project, and making declarative calls to the beam CLI.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Unity, in 2021+, we should use the SearchService instead of AssetDatabase for this. They say the performance is better due to some indexing/cacheing that this new service has. I haven't measured it, but... I don't think (or rather, I hope) that we can trust unity's own measurements about this.

The following steps must be taken for each Microservice
1. create a hidden Microservice folder in the location the `.asmdef` used to be,
2. populate it with the required service files by using the `beam project add` command,
3. copy the entire contents of the folder into the hidden folder's service folder. However, if there are subfolders with their own `.asmdef` files, do not copy those folders, or their decendents. This means we need to write our own recursive file copier.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this code as simple as possible. I believe this should be one or more simple functions to run a Breadth-First-Search over the directory tree using the usual Directory/Path/string types as opposed to any sort of complex abstraction.

Personally, I'd do this with a FIFO Queue over recursion, as there are opportunities to early out and recursion makes that harder to read, IMHO. To be a tad more specific on the implications to the algorithm, we don't need to find every nested asmdef. If a sub-tree contains a asmdef at its root, we don't need to expand it at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am all aboard the BFS queue approach over recursion 👍

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.

None yet

3 participants