{"id":23040874,"url":"https://github.com/ascentis/infrastructure","last_synced_at":"2025-10-31T10:51:28.184Z","repository":{"id":144158547,"uuid":"272519046","full_name":"Ascentis/Infrastructure","owner":"Ascentis","description":"General low level infrastructure modules for .NET projects","archived":false,"fork":false,"pushed_at":"2023-05-04T21:20:33.000Z","size":540,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-22T20:01:53.417Z","etag":null,"topics":["concurrency-patterns","data-structures","memorycache","threading"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ascentis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-15T18:51:48.000Z","updated_at":"2020-11-10T16:16:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"3eb9df0a-b8d3-41a7-972c-5fc62a148e6f","html_url":"https://github.com/Ascentis/Infrastructure","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Ascentis/Infrastructure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ascentis%2FInfrastructure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ascentis%2FInfrastructure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ascentis%2FInfrastructure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ascentis%2FInfrastructure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ascentis","download_url":"https://codeload.github.com/Ascentis/Infrastructure/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ascentis%2FInfrastructure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281976634,"owners_count":26592972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["concurrency-patterns","data-structures","memorycache","threading"],"created_at":"2024-12-15T19:19:53.311Z","updated_at":"2025-10-31T10:51:28.138Z","avatar_url":"https://github.com/Ascentis.png","language":"C#","readme":"# Ascentis.Infrastructure Library\n\nThis library offers a a few general purpose components:\n\n## ComPlusCache\nIt provides functionality similar to what MemoryCache provides.\n\nWhen to use this?\nIf you have a model where you run in one machine a farm of processes and want a drop-in easy way to implement a shared cache of data with functionality like the one provided by MemoryCache this class can help fulfill your needs.\n\nSome details to consider:\n\nStrongly recommended to store data using primitive types.\nString supported more efficiently using the overloaded methods that receive string as parameter. The rest of primitives supported using the other overload that receives an object (OleVariant if pure COM calls are made) as parameter.\nThe class supports serialized COM objects but performance is about 10x slower than serializing your object as text (JSON o XML) and then caching the text.\nWhen passing a COM object to store in cache, a shallow copy will be performed and the resulting copied object will be stored. Currently only public properties are copied over and there's no test to verify the behavior if within those properties there's a subobject.\nCurrent tests cover only the case of a COM DTO containing only primitive public properties.\n\n## AsyncDisposer\n\nUse this static class to dispose of IDisposable objects using async semantics.\nWhen to use this?\nIf you use third party software which you can't modify that has caused you trouble when disposing objects on an event which later makes software beyond your control throw exceptions because somewhere in the call stack it tries to use the diposed object.\nWith this class you can enqueue the IDisposable instance in the AsyncDisposer queue and it will be guaranteed to stay in queue for a specified global period of time before being take for disposal.\nTune the timing in a way that gives time enough for the calling procedure in the stack to complete and return to the caller. \n\nA second class part of this package is ConcurrentObjectAccessor\u003c\u003e. This class allows to wrap an object within it and allow for protected access\nto execute functions within a readlock. This allows usage of method SwapAndExecute() which allow to swap safely the underlying reference wrapped.\nWhen to use this? When dealing with COM, COM+ or DCOM objects prone to crashing or suffering from network partitions. With this class the COM\nobject can be isolated behing a wrapper relying on ConcurrentObjectAccessor and the low level object can be replaced transparently upon detection\nof partition exception.\n\n## Retrier\n\nThis class allows to wrap function or procedure calls in a try-catch block that would retry operations based on on a delegate function returning\ntrue or false. Can be combined with ConcurrentObjectAccessor to replace transparently a low level object upon certain conditions.\n\n## ConcurrentObjectAccessor\n\nThis class allows to control usage of an object reference permitting multiple concurrent threads using it for reading its value (and executing code with it),\nwhile only one thread can write to the reference at the same time. The main purpose is to replace a failing object transparently upon detection of a faulty condition.\nA concrete example is a COM+ object which crashed. The reference to this object is worthless until replaced by a new COM+ object instance.\n\n## SolidComPlus\n\nThis class encapsulates a COM+ object instance allowing the user to implement automatic swapping of a dead object. \n\n## SimpleMemoryCache\n\nReplacement for standard .NET MemoryCache based on ConcurrentDictionary. After opening the hood on MemoryCache found it over-complicated for most uses compared with ConcurrentDictionary.\nThis class is based on ConcurrentDictionary and provides expiration like MemoryCache using an ancillary timer.\n\n## BoundedParallel\n\nUse instead of standard static Parallel class to gain control of the number of concurrent calls that be executed using Parallel static class. This allows to control the number of threads\nfrom the default .NET threadpool to avoid a runaway scenario where .NET has to keep trying to add more threads. If a high number of callers attempt multiple concurrent calls to Parallel methods\nit can fall into what's called \"Hill Climbing\" algorithm causing high contention as .NET tries to add more threads slowly\n\n## AutoInit\n\nSmall utilitarian class that allow to initialize automatically a reference to an object provided the reference, a generic\ntype and optional constructor parameters.\nThis class depends on GenericObjectBuilder static class.\n\n## GenericObjectBuilder\n\nThis class allows to build an object of any class provided the generic type and either parameters or an array of\nparameter types and parameters. This class will build expression tree based constructors and cache them based on the\nsignature of the return type and the parameter types passed to the constructor.\n\n## Resettable\n\nThis class allows to \"reset\" the state of something using a small helper IDisposable interface that upon leaving the using scope\nit will call the a reset delegate method.\n\n## ConcurrentIncrementableResettable\n\nUtilitarian class relying on Resettable to allow incrementing an int in a thread safe manner and automatically decrementing\nthe value by the same amount when a helper object (Resettable) leaves the using scope.\n\n## Pool\n\nGeneralized Pool class. Will build instances lazily and wait for new objects returned to the pool when exhausted. Usage relies on simple Acquire() and Release() methods.\n\n## Conveyor\n\nAbstraction on top of a Thread that allows for continuous processing of objects passed by calling InsertPacket method. \n\n## DataPipeline\n\nGeneralized data pipeline from multiple source types (fixed length text, delimited, MSSQL, SQLite) to the same type of targets. The DataPipeline suite of classes provides\na high performance way to move data between source and targets(s) and it sets the foundation for further extension\n\n## DataReplicator\n\nThis class replicates tables into a SQLite database. Tables will be created automatically based on the metadata of a list of source queries\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascentis%2Finfrastructure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fascentis%2Finfrastructure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fascentis%2Finfrastructure/lists"}