{"id":19195111,"url":"https://github.com/ksachdeva/caf-playground","last_synced_at":"2025-02-23T04:37:45.200Z","repository":{"id":136497449,"uuid":"170960368","full_name":"ksachdeva/caf-playground","owner":"ksachdeva","description":"C++ Actor Framework Playground","archived":false,"fork":false,"pushed_at":"2019-04-17T16:01:25.000Z","size":91,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-04T08:35:50.292Z","etag":null,"topics":["actor-model","caf","examples","jupyter-notebooks"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/ksachdeva.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":"2019-02-16T03:58:07.000Z","updated_at":"2020-08-25T11:29:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bb74e07-bf3b-44d8-80bb-a7e69c436c0a","html_url":"https://github.com/ksachdeva/caf-playground","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/ksachdeva%2Fcaf-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksachdeva%2Fcaf-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksachdeva%2Fcaf-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksachdeva%2Fcaf-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksachdeva","download_url":"https://codeload.github.com/ksachdeva/caf-playground/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240271526,"owners_count":19774859,"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":["actor-model","caf","examples","jupyter-notebooks"],"created_at":"2024-11-09T12:08:36.051Z","updated_at":"2025-02-23T04:37:45.172Z","avatar_url":"https://github.com/ksachdeva.png","language":"Jupyter Notebook","readme":"# CAF Examples\n\nThis repository contains jupyter notebooks that illustrate various aspects\nof [C++ actor framework (CAF)](https://github.com/actor-framework/actor-framework).\n\n## Zero install setup [Running them using binder]\n\nThe advantage of writing examples using jupyter notebooks is that you can use both\nmarkdown and code in the same document.\n\n[https://mybinder.org](https://mybinder.org) provides functionality to run these notebooks (for free) in cloud and\nhence there is no setup/install/compilation required.\n\nClick on the below badge to go to[https://mybinder.org](https://mybinder.org) and launch.\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ksachdeva/caf-playground/master?urlpath=lab)\n\nPlease note that since binder is a free service, sometimes it takes a minute to launch the server for you. Once it launched, you will see the jupyter lab environment in your browser. The notebooks are in the `work` directory.\n\n## Running locally [only need docker]\n\nIf you want to run them locally and/or contribute some notebooks/examples then it is also very easy.\n\nAgain you do not have install any library/cmake/compiler etc. All you need is docker and if you are on\nlinux or osx just use the `run-locally.sh` script provided in this repository.\n\nIf you are on windows run the command as :\n\n```bash\ndocker run --rm -it -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v \u003cfull_path_notebooks_folder\u003e:/home/jovyan/notebooks ksachdeva17/caf:latest\n```\n\n## Some Limitations and resolutions\n\nJupyter notebooks are mostly written using `python` language however here we use `C++`. This is made possible\nby two projects - https://github.com/root-project/cling and https://github.com/QuantStack/xeus-cling.\n\nSupport for running C++ in notebooks is realtively new and so it is not as robust as that for python.\n\nThere are few limitations that you should be aware of -\n\n* If a cell in the notebook defines a C++ function or class, you can not execute it more than once. If you execute the cell again, the compiler will complain that symbol is already defined. It is logical from compilers perspective but inconvenient from users perspective !.\n\nI would recommend to always using `Restart the kernel` when you make changes to function/classes.\n\n## Only viewing the notebooks\n\nGithub natively supports viewing jupyter notebooks. Just click on the file however if you are interested in viewing using a better renderer then you can go to [https://nbviewer.jupyter.org/](https://nbviewer.jupyter.org/) and provide the path to this repository.\n\n### Examples\n\nThe order of examples is *kind* of important if you are new to CAF but not mandatory.\n\nHere is a suggested order to try :\n\n* [**hello-caf**](notebooks/hello-caf.ipynb)\n\nThe customary hello world but with a little twist. Demonstrates how to construct function and\nclass based actors. The purpose of this example is for you to get started very quickly with a\nsimple use case.\n\n* [**polymorphic-actors**](notebooks/polymorphic-actors.ipynb)\n\nThis example demonstrates how you can have different implementations of the same trait and \nthereby achieve polymorphism.\n\n* [**request-then**](notebooks/request-then.ipynb)\n\nThis example demonstrates the usage of `then` when you use `request`. Usage of `then` keeps the mailbox\nof an actor active i.e. messages to its other behaviors can still be sent and processed.\n\n* [**request-await**](notebooks/request-await.ipynb)\n\nThis example demonstrates the usage of `await` when you use `request`. Usage of `await` informs the framework (CAF) that it should not send messages to its other behaviors while it waiting for the `request` to finish.\n\n* [**monitoring-actors**](notebooks/monitoring-actors.ipynb)\n\nThis example shows how one actor can terminate (logical unregistration) itself from the actor\nsystem and how other actors can monitor such events.\n\n* [**ref-of-cls-actors**](notebooks/ref-of-cls-actors.ipynb)\n\nThis example tries to construct a scenario where an actor would like to send its reference (at some time in future i.e. not at its construction) to another actor. The other actor would then use the supplied reference to send messages.\n\nPlease note that the scenario in this example is bit convoluted and normally you should not write your code like this.\n\nPlease read the comments in the code for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksachdeva%2Fcaf-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksachdeva%2Fcaf-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksachdeva%2Fcaf-playground/lists"}