{"id":18350312,"url":"https://github.com/ollls/zio-quartz-ee","last_synced_at":"2025-04-09T23:51:21.699Z","repository":{"id":153204317,"uuid":"350769694","full_name":"ollls/zio-quartz-ee","owner":"ollls","description":"Enterprise use cases for zio-tls-http. Connection pooling, fast mem-cache server with ZIO Layers and ZIO magic. LDAP Unbound SDK bindings to ZIO.  Https client with TLS encryption performed as ZIO effects.","archived":false,"fork":false,"pushed_at":"2021-04-18T18:55:15.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T23:51:18.725Z","etag":null,"topics":["caching","connection","connection-pooling","ldap","massively-parallel","unbound","zio","zio-effect","zio-layer","zio-magic","zio-tls-http"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/ollls.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}},"created_at":"2021-03-23T15:49:17.000Z","updated_at":"2021-04-18T18:55:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6256091-4122-4891-af33-137e01cd23c2","html_url":"https://github.com/ollls/zio-quartz-ee","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollls%2Fzio-quartz-ee","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollls%2Fzio-quartz-ee/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollls%2Fzio-quartz-ee/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollls%2Fzio-quartz-ee/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollls","download_url":"https://codeload.github.com/ollls/zio-quartz-ee/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131455,"owners_count":21052819,"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","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":["caching","connection","connection-pooling","ldap","massively-parallel","unbound","zio","zio-effect","zio-layer","zio-magic","zio-tls-http"],"created_at":"2024-11-05T21:26:04.066Z","updated_at":"2025-04-09T23:51:21.669Z","avatar_url":"https://github.com/ollls.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zio-quartz\n\nEnterprise use cases for zio-tls-http server.\u003cbr\u003e\u003cbr\u003e\nThe code assumes that you have access to LDAP compliant directoty to test conn. pooling and cachig.\nIf not, just use it as a reference, I will be more than happy to post any other examples in our catalog of use cases.\nAlso, please see: \"Dummy layers with ResPool[Unit] resource to test cache with random number generator\".\n\n## Additional dependencies:\n\nThe project philosophy is to limit the use third party libs, if anything can be done on regular JDK it will be done on JDK.\n\n* ZIO-Magic\n* Ping Unbound LDAP SDK\n\n## Internal components used: \n\n* LDAP and HTTPS Connection pooling and caching layers, high perfomance, lock-free, massively parallel. \n* Async LDAP access thru Unbound SDK with async ZIO bindings.\n* Async, Efectfull(ZIO) TLS HTTPClient.\n* Carefully crafted logging for connection pooling/caching to see different Layer of the same class.  For example: ResPool[HttpClient] vs ResPool[LDAPClient] \n( there is a version of conn pool with names, not used in the example )\n\n\u003ci\u003e\nFuture plans are to provide OAUTH2 client filter example, connection limiter and fast in-memory data table. \nWeb filters on zio-tls-http are comoosable with \u003c\u003e\n\u003c/i\u003e  \n  \n ## High memory scenarios.\n \n    export SBT_OPTS=\"-Xmx5G\" \n    \n Very rough estimate 200-500 MB per million of entries. To avoid perf issues please make sure you have enough memory for your cache/caches.\n Cache poisioning with 100% LRU eviction will slow down TPS about 60%. Currently, only one fiber doing evictions. This is not an issue for any real scenario.\n \n ## LRU Locks, semaphore table.\n \n Cache will work with millions of entries with all your CPU cores busy, due to LRU tracking there will be a semaphore sync thru semaphore table, between regular and LRU table.\n Each record locked individually with semaphore key calculated( maped ) from main mem cache table:  \n \n    semaphore_key \u003c- ZIO(key.hashCode % 1024)  \n    \n This will limit semaphore table, agreed that 64 or 128 is enough, this is just to lessen a chance of any key collisions.   \n  \n ## ZIO-Quartz Layers:\n  \n ### Resource Pool ZIO Layer - connection pooling, you will need to provide two functions: create and release. Can be used with any resources, JDBC, etc..\n \n    \n    object ResPool\n   \n    def makeM[R](\n      timeToLiveMs: Int,\n      createResource: () =\u003e ZIO[ZEnv, Exception, R],\n      closeResource: (R) =\u003e ZIO[ZEnv, Exception, Unit)\n      (implicit tagged: Tag[R] )\n  \n    def make[R](\n      timeToLiveMs: Int, \n      createResource: () =\u003e R,\n      closeResource: (R) =\u003e Unit)\n      (implicit tagged: Tag[R])\n    \n    trait Service[R] {\n      def acquire: ZIO[zio.ZEnv with MyLogging, Throwable, R]\n      def release(res: R): ZIO[ZEnv with MyLogging, Throwable, Unit]\n    }\n    \n ### Resource Pool Cache ZIO Layer.\n \n TBD\n    \n ### Dummy layers with ResPool[Unit] resource to test cache with random number generator.\n    \n    //Layers\n    val logger_L = MyLogging.make((\"console\" -\u003e LogLevel.Trace), (\"access\" -\u003e LogLevel.Info))\n    val dummyConPool_L = ResPool.make[Unit](timeToLiveMs = 20 * 1000, () =\u003e (), (Unit) =\u003e ())\n    val cache_L =\n      ResPoolCache.make(timeToLiveMs = 10 * 1000, limit = 4000001, (u: Unit, number: String) \n                   =\u003e ZIO.succeed( if ( false ) None else Some(number ) ))\n\n    //all layers visibe\n    edgz_Http\n      .run(myHttpRouter.route)\n      .provideSomeLayer[ZEnv with MyLogging with ResPool[Unit]](cache_L)\n      .provideSomeLayer[ZEnv with MyLogging](dummyConPool_L)\n      .provideSomeLayer[ZEnv](logger_L)\n      .exitCode\n  }\n\n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follls%2Fzio-quartz-ee","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follls%2Fzio-quartz-ee","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follls%2Fzio-quartz-ee/lists"}