{"id":16515087,"url":"https://github.com/shogowada/scala-json-rpc","last_synced_at":"2026-03-06T16:34:26.087Z","repository":{"id":57734805,"uuid":"74464337","full_name":"shogowada/scala-json-rpc","owner":"shogowada","description":"Let your servers and clients communicate over function calls! JSON-RPC 2.0 library for Scala and Scala.js","archived":false,"fork":false,"pushed_at":"2023-06-16T15:45:29.000Z","size":263,"stargazers_count":40,"open_issues_count":4,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-03T19:01:38.293Z","etag":null,"topics":["json-rpc","rpc","scala","scalajs"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/shogowada.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2016-11-22T11:06:59.000Z","updated_at":"2022-11-27T19:28:19.000Z","dependencies_parsed_at":"2024-10-28T10:14:34.615Z","dependency_job_id":"25f20c30-4edc-4125-9d75-b12d5f4bb410","html_url":"https://github.com/shogowada/scala-json-rpc","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/shogowada/scala-json-rpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogowada%2Fscala-json-rpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogowada%2Fscala-json-rpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogowada%2Fscala-json-rpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogowada%2Fscala-json-rpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shogowada","download_url":"https://codeload.github.com/shogowada/scala-json-rpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogowada%2Fscala-json-rpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30185551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["json-rpc","rpc","scala","scalajs"],"created_at":"2024-10-11T16:15:09.968Z","updated_at":"2026-03-06T16:34:21.063Z","avatar_url":"https://github.com/shogowada.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scala-json-rpc\n\n**⚠️ This project is not maintained anymore, and I'm looking for a kind person who can take it over from me.  \nIf you can inherit this project, please send a pull request to this README.md linking to your project so that we can direct people to the new home.**\n\nmaster: [![Master Build Status](https://travis-ci.org/shogowada/scala-json-rpc.svg?branch=master)](https://travis-ci.org/shogowada/scala-json-rpc)\n\nLet your servers and clients communicate over function calls!\n\nscala-json-rpc is a Remote Procedure Call (RPC) library honorring [JSON-RPC 2.0 spec](http://www.jsonrpc.org).\n\nJSON-RPC defines a specification of RPC in JSON format. This means that you can achieve RPC between your components as long as they are capable of\n\n- Serializing and deserializing JSON\n- Passing strings around\n\n```\n+--------+                          +--------+\n|        | ---[request as JSON]---\u003e |        |\n| Client |                          | Server |\n|        | \u003c--[response as JSON]--- |        |\n+--------+                          +--------+\n```\n\n## Quick look\n\n### Shared between server and client\n\nUsing scala-json-rpc, your server and client can communicate over statically typed interfaces like below:\n\n```scala\ntrait LoggerAPI {\n  def log(message: String): Unit\n}\n\ncase class Foo(id: String)\n\ntrait FooRepositoryAPI {\n  def add(foo: Foo): Future[Unit]\n  def remove(foo: Foo): Future[Unit]\n  def getAll(): Future[Set[Foo]]\n}\n```\n\n### Server\n\n```scala\nclass LoggerAPIImpl extends LoggerAPI {\n  override def log(message: String): Unit = println(message)\n}\n\nclass FooRepositoryAPIImpl extends FooRepositoryAPI {\n  var foos: Set[Foo] = Set()\n\n  override def add(foo: Foo): Future[Unit] = this.synchronized {\n    foos = foos + foo\n    Future() // Acknowledge\n  }\n\n  override def remove(foo: Foo): Future[Unit] = this.synchronized {\n    foos = foos - foo\n    Future() // Acknowledge\n  }\n\n  override def getAll(): Future[Set[Foo]] = Future {\n    foos\n  }\n}\n\nval jsonSerializer = // ...\nval server = JSONRPCServer(jsonSerializer)\nserver.bindAPI[LoggerAPI](new LoggerAPIImpl)\nserver.bindAPI[FooRepositoryAPI](new FooRepositoryAPIImpl)\n\ndef onRequestJSONReceived(requestJSON: String): Unit = {\n  server.receive(requestJSON).onComplete {\n    case Success(Some(responseJSON: String)) =\u003e sendResponseJSONToClient(responseJSON)\n    case _ =\u003e\n  }\n}\n```\n\n### Client\n\n```scala\nval jsonSerializer = // ...\nval jsonSender = // ...\nval client = JSONRPCClient(jsonSerializer, jsonSender)\n\nval loggerAPI = client.createAPI[LoggerAPI]\nval fooRepositoryAPI = client.createAPI[FooRepositoryAPI]\n\nloggerAPI.log(\"Hello, World!\")\n\nfooRepositoryAPI.add(Foo(\"A\"))\nfooRepositoryAPI.add(Foo(\"B\"))\n\nfooRepositoryAPI.remove(Foo(\"A\"))\n\nfooRepositoryAPI.getAll().onComplete {\n  case Success(foos: Set[Foo]) =\u003e println(s\"Received all the foos: $foos\")\n  case _ =\u003e\n}\n\ndef onResponseJSONReceived(responseJSON: String): Unit = {\n  client.receive(responseJSON)\n}\n```\n\n## Dependency\n\n|Platform|SBT|Scala Version|Scala JS Version|\n|---|---|---|---|\n|JVM|```\"io.github.shogowada\" %% \"scala-json-rpc\" % \"0.9.3\"```|2.12||\n|JS|```\"io.github.shogowada\" %%% \"scala-json-rpc\" % \"0.9.3\"```|2.12|0.6.17+|\n\nscala-json-rpc has **no external dependency**, so it should fit into any of your Scala JVM \u0026 JS applications.\n\n## Tutorials\n\n- [Basic](/tutorials/basic.md)\n- [Custom JSON-RPC method name](/tutorials/custom-json-rpc-method-name.md)\n- [Passing function as parameter or return value or both](/tutorials/passing-function-as-parameter-or-return-value-or-both.md) :tada:\n\n## Examples\n\n- [Unidirectional JSON-RPC from Scala JS to Scala JVM over HTTP](/examples/e2e)\n- [Bidirectional JSON-RPC between Scals JS and Scala JVM over WebSocket](/examples/e2e-web-socket)\n\n## TODOs\n\nIt should already serve you well as a RPC library, but it still does not fully support JSON-RPC spec yet. Here are list of known JSON-RPC features that's not supported yet.\n\n- Send/receive named parameter\n    - Define custom parameter name\n- Send/receive custom JSON-RPC error\n- Define custom JSON-RPC request ID\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogowada%2Fscala-json-rpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshogowada%2Fscala-json-rpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogowada%2Fscala-json-rpc/lists"}