{"id":16696693,"url":"https://github.com/atry/commons-continuations","last_synced_at":"2025-04-10T02:41:41.766Z","repository":{"id":2702441,"uuid":"3696104","full_name":"Atry/commons-continuations","owner":"Atry","description":"Utilities for Scala continuations","archived":false,"fork":false,"pushed_at":"2014-08-25T14:52:19.000Z","size":302,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T04:11:47.284Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Atry.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}},"created_at":"2012-03-12T14:51:49.000Z","updated_at":"2017-07-19T20:07:22.000Z","dependencies_parsed_at":"2022-09-26T21:40:32.846Z","dependency_job_id":null,"html_url":"https://github.com/Atry/commons-continuations","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atry%2Fcommons-continuations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atry%2Fcommons-continuations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atry%2Fcommons-continuations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atry%2Fcommons-continuations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Atry","download_url":"https://codeload.github.com/Atry/commons-continuations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248144948,"owners_count":21055013,"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":[],"created_at":"2024-10-12T17:44:35.370Z","updated_at":"2025-04-10T02:41:41.739Z","avatar_url":"https://github.com/Atry.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"**commons-continuations** is a collection of utilities which is designed to help Scala programmers to work with continuations.\r\n\r\n# Features\r\n\r\n## Allow `for` statement with a suspendable code block.\r\n\r\n\timport com.dongxiguo.commons.continuations.CollectionConverters._\r\n\timport scala.util.continuations.shiftUnit\r\n\tval mySeq = Seq(\"foo\", \"bar\", \"baz\")\r\n\tval results = for (element in mySeq.asSuspendable.par) yield {\r\n\t  shiftUnit(\"Result from a suspendable expression: \" + element)\r\n\t}\r\n\r\n## Hang up a continuation\r\n\r\n\timport com.dongxiguo.commons.continuations.Hang\r\n\timport scala.util.continuations.shift\r\n\tshift(Hang)\r\n\r\n## The `goto` statement\r\n\r\n\timport com.dongxiguo.commons.continuations.Label\r\n\tval repeatPoint = Label()\r\n\tdoSomething()\r\n\trepeatePoint.goto() // Infinite loop\r\n\r\n## Use continuation with NIO2 socket.\r\n\r\nSee [AsynchronousInputStream](https://github.com/Atry/commons-continuations/blob/master/src/main/scala/com/dongxiguo/commons/continuations/io/AsynchronousInputStream.scala)\r\nand [SocketWritingQueue](https://github.com/Atry/commons-continuations/blob/master/src/main/scala/com/dongxiguo/commons/continuations/io/SocketWritingQueue.scala).\r\n\r\n# Repository\r\n\r\nIf you use Sbt, add following lines to you `build.sbt`:\r\n\t\r\n\tlibraryDependencies += \"com.dongxiguo\" %% \"commons-continuations\" % \"0.2.2\"\r\n\r\nNote that `commons-continuations` requires Scala version `2.10.x` or `2.11.x`.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatry%2Fcommons-continuations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatry%2Fcommons-continuations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatry%2Fcommons-continuations/lists"}