{"id":18556349,"url":"https://github.com/rsocket/rsocket-swift","last_synced_at":"2025-04-10T00:31:08.087Z","repository":{"id":39992991,"uuid":"311687754","full_name":"rsocket/rsocket-swift","owner":"rsocket","description":"Swift implementation of RSocket Protocol","archived":false,"fork":false,"pushed_at":"2023-08-21T10:43:00.000Z","size":568,"stargazers_count":76,"open_issues_count":6,"forks_count":15,"subscribers_count":21,"default_branch":"main","last_synced_at":"2024-05-09T09:55:30.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/rsocket.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2020-11-10T14:41:57.000Z","updated_at":"2024-02-20T03:56:32.000Z","dependencies_parsed_at":"2023-01-30T00:01:16.655Z","dependency_job_id":null,"html_url":"https://github.com/rsocket/rsocket-swift","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/rsocket%2Frsocket-swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsocket%2Frsocket-swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsocket%2Frsocket-swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsocket%2Frsocket-swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsocket","download_url":"https://codeload.github.com/rsocket/rsocket-swift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223418592,"owners_count":17142172,"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-11-06T21:29:59.843Z","updated_at":"2024-11-06T21:30:00.640Z","avatar_url":"https://github.com/rsocket.png","language":"Swift","readme":"# RSocket Swift\nRSocket Swift is a Client and Server implementation of the RSocket  (**R**eactive **Socket**) network protocol on top of SwiftNIO. It's an **alpha** version and still under active development.\n**Do not use it in a production environment!**\n\n## What is RSocket?\nRSocket provides a protocol for Reactive Streams semantics between client-server, and server-server communication. It is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron.\nKey Features:\n* support for interaction models beyond request/response such as streaming responses and push\n* application-level flow control semantics (async pull/push of bounded batch sizes) across network boundaries\n* binary, multiplexed use of a single connection\n* support resumption of long-lived subscriptions across transport connections\n\nMore Information about RSocket can be found at [rsocket.io](https://rsocket.io/) and a great presentation from @OlegDokuka is available on [YouTube](https://www.youtube.com/watch?v=KapSjhUYSz4). \n\n### Modules\nThe implementation is split into multiple modules. This allows a user of this package to only include what is really needed.\n\n\n```mermaid\ngraph TD\n    U[User]\n    U --\u003e A;\n    U --\u003e D;\n    U --\u003e F;\n    CORE[RSocketCore];\n    subgraph Channel\n        A[RSocketTSChannel];\n        B[RSocketNIOChannel];\n    end\n    subgraph Transport Protocol\n        C[RSocketWSTransport];\n        D[RSocketTCPTransport];\n    end\n    subgraph Reactive Streams\n        E[RSocketCombine];\n        F[RSocketReactiveSwift];\n    end\n    A --\u003e CORE;\n    B --\u003e CORE;\n    C --\u003e CORE;\n    D --\u003e CORE;\n    E --\u003e CORE;\n    F --\u003e CORE;\n```\n\n`RSocketCore`, as the name implies, contains the core logic which every other module depends on.\nThe other modules are grouped in one of three categories:\n\n* **Channel** - convenience client bootstrap implementation which configures a SwiftNIO Channel Pipeline and takes care of TLS/SSL, EventLoopGroup creation and shutdown. Either `RSocketTSChannel` which uses swift-nio-transport-services (i.e. Network.framework) or `RSocketNIOChannel` which uses `swift-nio-ssl` for TLS/SSL and the default channel implementation for a TCP connection.\n\n* **Transport Protocol** - RSocket can run on top of any message-stream oriented transport protocol. `RSocketWSTransport` contains channel handlers which allow RSocket to run over WebSocket. `RSocketTCPTransport` is the equivalent for a plain TCP connection.\n\n* **Reactive Streams** - RSocket Swift lets you choose which implementation of Reactive Streams you want to use. ReactiveSwift is implemented, Combine and [async/await/AsyncSequence](https://github.com/rsocket/rsocket-swift/pull/44) are work in progress. You can also mix two reactive stream libraries and do some requests with Combine and some with async/await over the same connection.\n\nA User will usually only chose one from each category. \n\n## Current State\nAll [Mandatory Core Protocol Features](https://rsocket.io/docs/implementations) have been implemented and tested against the Java and Kotlin implementation.\nWorking examples can be found under [Sources/Examples](https://github.com/rsocket/rsocket-swift/tree/main/Sources/Examples). [TimerClient](https://github.com/rsocket/rsocket-swift/blob/main/Sources/Examples/TimerClient/main.swift) and [TwitterClient](https://github.com/rsocket/rsocket-swift/blob/main/Sources/Examples/TwitterClient/main.swift) connect to [demo.rsocket.io/rsocket](http://demo.rsocket.io/) where a [Kotlin Server is running](https://github.com/rsocket/rsocket-demo/tree/master/src/main/kotlin/io/rsocket/demo/) and work without running a server locally.\nThe Client API has currently a lot more convenience API's and is a lot simpler than the Server API. If you want to create an RSocket Server you need to create you own SwiftNIO pipeline and setup SSL/TLS yourself. This will be improved in the future as we implement [some RSocket extensions](https://github.com/rsocket/rsocket/tree/master/Extensions) like [Routing](https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md).\n\n### Transport\n- [x] WebSocket\n- [x] TCP\n\n### Reactive Streams\n- [ ] [async/await \u0026 AsyncSeqence](https://github.com/rsocket/rsocket-swift/pull/44)\n- [ ] Combine\n- [x] ReactiveSwift\n- [ ] RxSwift\n\n## What is planned\n* Automatic reconnect for Clients\n* [RSocket extensions](https://github.com/rsocket/rsocket/tree/master/Extensions) including [Composite Metadata](https://github.com/rsocket/rsocket/blob/master/Extensions/CompositeMetadata.md), [Routing](https://github.com/rsocket/rsocket/blob/master/Extensions/Routing.md) and [per Stream Data MIME Types](https://github.com/rsocket/rsocket/blob/master/Extensions/PerStreamDataMimeTypesDefinition.md)\n* Autogenerated Documentation\n* Server Examples\n* Combine and async/await \u0026 AsyncSeqence\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsocket%2Frsocket-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsocket%2Frsocket-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsocket%2Frsocket-swift/lists"}