{"id":17212299,"url":"https://github.com/kung-foo/gocn","last_synced_at":"2025-09-16T15:52:26.595Z","repository":{"id":33406215,"uuid":"37051415","full_name":"kung-foo/gocn","owner":"kung-foo","description":"Tideland Go Cell Network","archived":false,"fork":false,"pushed_at":"2015-03-26T10:59:42.000Z","size":236,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T11:41:44.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kung-foo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2015-06-08T07:09:15.000Z","updated_at":"2020-05-01T12:21:17.000Z","dependencies_parsed_at":"2022-09-05T20:50:12.317Z","dependency_job_id":null,"html_url":"https://github.com/kung-foo/gocn","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/kung-foo%2Fgocn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kung-foo%2Fgocn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kung-foo%2Fgocn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kung-foo%2Fgocn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kung-foo","download_url":"https://codeload.github.com/kung-foo/gocn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245466670,"owners_count":20620206,"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-15T02:59:44.701Z","updated_at":"2025-09-16T15:52:21.533Z","avatar_url":"https://github.com/kung-foo.png","language":"Go","readme":"# Tideland Go Cell Network\n\n## Description\n\nThe *Tideland Go Cell Network* (GOCN) is a framework for event and\nbehavior based applications. It provides a runtime environment\nfor connected cells. These receive events, process them and emit\nnew events to their subscribers. The way how cells process the\nevents is defined by behaviors implementing an interface. Some\nare already included.\n\n## Installation\n\n```\ngo get github.com/tideland/gocn/v3/cells\ngo get github.com/tideland/gocn/v3/behaviors\ngo get github.com/tideland/gocn/v3/testsupport\n```\n\n## Usage\n\n### Cells\n\nNew environments are created with\n\n```\nenv := cells.NewEnvironment()\n```\n\nand cells are added with\n\n```\nenv.StartCell(\"foo\", NewFooBehavior())\n```\n\nCells then can be subscribed with\n\n```\nenv.Subscribe(\"foo\", \"bar\")\n```\n\nso that events emitted by the \"foo\" cell during the processing of\nevents will be received by the \"bar\" cell. Each cell can have\nmultiple cells subscibed.\n\nEvents from the outside are emitted using\n\n```\nenv.Emit(\"foo\", myEvent)\n```\n\nor\n\n```\nenv.EmitNew(\"foo\", \"myTopic\", cells.PayloadValues{\n        \"KeyA\": 12345,\n        \"KeyB\": true,\n}, myScene)\n```\n\nBehaviors have to implement the `cells.Behavior` interface. Here\nthe `Init()` method is called with a `cells.Context`. This can be\nused inside the `ProcessEvent()` method to emit events to subscribers\nor directly to other cells of the environment.\n\nSometimes it's needed to directly communicate with a cell to retrieve\ninformation. In this case the method\n\n```\nresponse, err := env.Request(\"foo\", \"myRequest?\", myPayload, myScene, myTimeout)\n```\n\nis to be used. Inside the `ProcessEvent()` of the addressed cell the\nevent can be used to send the response with\n\n```\nswitch event.Topic() {\ncase \"myRequest?\":\n        event.Respond(someIncredibleData)\ncase ...:\n        ...\n}\n```\n\nInstructions without a response are simply done by emitting an event.\n\n[![GoDoc](https://godoc.org/github.com/tideland/gocn/v3/cells?status.svg)](https://godoc.org/github.com/tideland/gocn/v3/cells)\n\n### Behaviors\n\nSome behaviors are already included:\n\n- a *broadcaster* beavior that simply emits the received events to all subscribers,\n- a *collector* behavior that collects events and returns them on demand,\n- a *counter* behavior that counts events based on a passed function,\n- a *filter* behavior that filters and emits events based on a passed function,\n- a *finite state machine* bahvior that provides a simple way for state machines,\n- a *logger* behavior logging the received events,\n- a *mapper* behavior mapping received events to other emitted events based on\n  a passed function,\n- a *round-robin* behavior emitting received events round robin to its\n  subscribers,\n- a *router* behavior routing events to individual subscribers based on a\n  passed function and\n- a *ticker* behavior emitting events based on a timer.\n\nMore to come.\n\n[![GoDoc](https://godoc.org/github.com/tideland/gocn/v3/behaviors?status.svg)](https://godoc.org/github.com/tideland/gocn/v3/behaviors)\n\n### Testsupport\n\nThe test support package is only needed if local changes and Go tests\nare planned.\n\n[![GoDoc](https://godoc.org/github.com/tideland/gocn/v3/testsupport?status.svg)](https://godoc.org/github.com/tideland/gocn/v3/testsupport)\n\n## Authors\n\n- Frank Mueller - \u003cmue@tideland.biz\u003e\n\n## License\n\n*Tideland Go Cell Network* is distributed under the terms of the BSD 3-Clause license.\n\n*And now have fun.* ;)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkung-foo%2Fgocn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkung-foo%2Fgocn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkung-foo%2Fgocn/lists"}