{"id":37057525,"url":"https://github.com/simulation-tree/data-systems","last_synced_at":"2026-01-14T06:30:24.487Z","repository":{"id":301744356,"uuid":"824337145","full_name":"simulation-tree/data-systems","owner":"simulation-tree","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-24T03:03:50.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-27T09:41:37.956Z","etag":null,"topics":["csharp","dotnet"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simulation-tree.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-04T22:52:28.000Z","updated_at":"2025-09-24T03:00:50.000Z","dependencies_parsed_at":"2025-06-28T15:35:35.199Z","dependency_job_id":null,"html_url":"https://github.com/simulation-tree/data-systems","commit_stats":null,"previous_names":["simulation-tree/data-systems"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/simulation-tree/data-systems","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fdata-systems","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fdata-systems/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fdata-systems/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fdata-systems/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simulation-tree","download_url":"https://codeload.github.com/simulation-tree/data-systems/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fdata-systems/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet"],"created_at":"2026-01-14T06:30:22.282Z","updated_at":"2026-01-14T06:30:24.472Z","avatar_url":"https://github.com/simulation-tree.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Systems\n\nImplements the `data` project with a system that loads data from various sources.\n\n### Loading from an entity\n\n```cs\nDataSource source = new(world, \"fileA\");\nsource.WriteUTF8(\"Some data here!\");\n\nDataRequest request = new(world, \"fileA\");\n\nsimulator.Update();\n\nusing ByteReader reader = new(request.CreateByteReader());\nSpan\u003cchar\u003e dataBuffer = stackalloc char[32];\nuint textLength = reader.ReadUTF8Span(dataBuffer);\nstring loadedData = dataBuffer.Slice(0, textLength).ToString();\nConsole.WriteLine($\"Loaded data from an entity {loadedData}\");\n```\n\n### Loading from file on disk\n\n```cs\nDataRequest request = new(world, \"C:/fileB.txt\");\n\nsimulator.Update();\n\nusing ByteReader reader = new(request.CreateByteReader());\nSpan\u003cchar\u003e dataBuffer = stackalloc char[32];\nuint textLength = reader.ReadUTF8Span(dataBuffer);\nstring loadedData = dataBuffer.Slice(0, textLength).ToString();\nConsole.WriteLine($\"Loaded data from a file {loadedData}\");\n```\n\n### Loading from an embedded resource\n\nEmbedded resources in a project can be loaded if their address is registered:\n```cs\npublic readonly struct MyEmbeddedResources : IEmbeddedResourceBank\n{\n    void IEmbeddedResourceBank.Load(Register register)\n    {\n        register.Invoke(\"Assets/test.txt\");\n    }\n}\n\nEmbeddedResourceRegistry.Load\u003cMyEmbeddedResources\u003e();\nDataRequest request = new(world, \"Assets/test.txt\");\n\nsimulator.Update();\n\nusing ByteReader reader = new(request.CreateByteReader());\nSpan\u003cchar\u003e dataBuffer = stackalloc char[32];\nuint textLength = reader.ReadUTF8Span(dataBuffer);\nstring loadedData = dataBuffer.Slice(0, textLength).ToString();\nConsole.WriteLine($\"Loaded data from an embedded resource {loadedData}\");\n```\n\n### Loading through a message\n\nData can be loaded by another system through the `LoadData` message:\n```cs\nLoadData message = new(\"Assets/test.txt\");\nsimulator.Broadcast(ref message);\nif (message.TryConsume(out ByteReader data))\n{\n    Span\u003cchar\u003e dataBuffer = stackalloc char[32];\n    uint textLength = data.ReadUTF8Span(dataBuffer);\n    string loadedData = dataBuffer.Slice(0, textLength).ToString();\n    Console.WriteLine($\"Loaded data through a message {loadedData}\");\n    data.Dispose();\n}\nelse\n{\n    Console.WriteLine(\"Failed to load data through a message\");\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Fdata-systems","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimulation-tree%2Fdata-systems","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Fdata-systems/lists"}