{"id":27918779,"url":"https://github.com/juliaparallel/messageutils.jl","last_synced_at":"2025-09-07T10:35:05.608Z","repository":{"id":14127591,"uuid":"16832829","full_name":"JuliaParallel/MessageUtils.jl","owner":"JuliaParallel","description":"channels(), tspaces(), kvspaces() and more","archived":false,"fork":false,"pushed_at":"2023-03-14T12:48:16.000Z","size":17,"stargazers_count":7,"open_issues_count":4,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-06T18:50:19.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaParallel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2014-02-14T09:30:06.000Z","updated_at":"2023-09-05T12:41:02.000Z","dependencies_parsed_at":"2025-05-06T18:49:36.107Z","dependency_job_id":null,"html_url":"https://github.com/JuliaParallel/MessageUtils.jl","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaParallel/MessageUtils.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaParallel%2FMessageUtils.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaParallel%2FMessageUtils.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaParallel%2FMessageUtils.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaParallel%2FMessageUtils.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaParallel","download_url":"https://codeload.github.com/JuliaParallel/MessageUtils.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaParallel%2FMessageUtils.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274026710,"owners_count":25209739,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-05-06T18:25:32.303Z","updated_at":"2025-09-07T10:35:05.563Z","avatar_url":"https://github.com/JuliaParallel.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"MessageUtils\n============\n\nA collection of utilities for messaging\n\nChannels\n--------\n\nChannels are like RemoteRefs, execpt that they are modelled as a queue and hence can hold\nmore than one message.\n\n`channel(pid=myid(); T=Any, sz=1000)` constructs a channel on process `pid`, holds objects of\ntype `T` with a maximum number of entries `sz`.\n\nThe `channel` constructor returns an object reference of type `SyncObjRef{RemoteChannel}`\nwhich can be passed around safely across processes.\n\n`isready(c)`, `fetch(c)`, `take!(c)` and `put!(c, v)` have the same behaviour as the `RemoteRef`\nequivalents.\n\n`fetch` and `take!` block if there are no elements.\n\n`put!` blocks if the channel already has `sz` elements present.\n\n`fetch`, `take!` and `put!` all accept an optional `keyword` argument `timeout` which specifies\nthe maximum number of seconds to block. If the request cannot be fulfilled within the requested\ntime a `MUtilTimeOutEx` exception is thrown.\n\n\nTSpaces\n-------\n\nTSpaces are tuple spaces. They store tuples, the first element of each tuple is a key\nto the tuple.\n\nThe tuples are stored as a queue and duplicates are allowed.\n\n`tspace(pid=myid(); sz=1000)` constructs a new tuple space and returns\na `SyncObjRef{RemoteTSpace}`\n\n`put!(ts, v::Tuple)` adds a tuple `v` into the space `ts`.\n\n`isready(ts,k)`, `fetch(ts, k)` and `take!(ts, k)` all require the key `k` to be specified when\nused on a tuple space `ts`. It is matched against the first element of the tuples in the space.\n\nIf `k` is a `Regex` object, it is matched against all tuples where the firest element is a\n`String`\n\n`fetch`, `take!` and `put!` all accept an optional `keyword` argument `timeout` which specifies\nthe maximum number of seconds to block. If the request cannot be fulfilled within the requested\ntime a `MUtilTimeOutEx` exception is thrown.\n\n\nKVSpaces\n--------\n\nThis is a key-value store.\n\n`kvspace(pid=myid(); sz=1000)` constructs a new key-value space and returns\na `SyncObjRef{RemoteKVSpace}`. Duplicates are not allowed. A `put!` with an existing key\noverwrites the existing value\n\n`put!(kvs, k, v)` adds key `k` and value `v` into the space `kvs`.\n\n`isready(kvs,k)`, `fetch(kvs, k)` and `take!(kvs, k)` all require the key `k` to be specified when\nused on a kv space `kvs`.\n\n`fetch`, `take!` and `put!` all accept an optional `keyword` argument `timeout` which specifies\nthe maximum number of seconds to block. If the request cannot be fulfilled within the requested\ntime a `MUtilTimeOutEx` exception is thrown.\n\n\nctasks - Tasks with Channels\n----------------------------\n\nctasks are named tasks with channels. The channels are used for messaging with the task.\n\n`ctask(f::Function; pid=myid(), name=\"\")` returns a `CTask` object that can be passed around\nprocessors.\n\n`f` is the function lanuched on processor `pid`. The ctask runs till function `f` terminates.\nIf `name` is specified, the task is addressable by name. The name-ctask mapping is stored in\na KV Space on pid 1.\n\nEvery ctask has two channels associated with it. One for incoming messages and one for outbound\nmessages.\n\nThe following functions can be used to send/recv messages from these channels.\n\n`put!(msg::Tuple)` appends a message to a tasks outbound channel\n\n`put!(ct::CTask, msg::Tuple)` appends a message to task `ct`'s inbound channel\n\n`put!(ctname::String, msg::Tuple)` appends a message to task addressed by `ctname`'s inbound channel\n\n`take!()` pops a message from the current tasks inbound channel\n\n`take!(ct::CTask)` pops a message from task `ct`'s outbound channel\n\n`take!(ctname::String)` pops a message from the task addressed by `ctname`'s outbound channel\n\nThe pipelining operator `|\u003e` can be used to send a message to a task. For example:\n\n`(:test_msg, \"Hello\") |\u003e ct` will add the tuple `(:test_msg, \"Hello\")` to `ct`'s inbound channel\n\n`put!`, `take!` both accept an optional `keyword` argument `timeout` which specifies\nthe maximum number of seconds to block. If the request cannot be fulfilled within the requested\ntime a `MUtilTimeOutEx` exception is thrown.\n\nNote: The Julia 0.3 compatible version has `send`/`recv` in place of `put!`/`take`. \nThis has been renamed in 0.4 for consistency.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaparallel%2Fmessageutils.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliaparallel%2Fmessageutils.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliaparallel%2Fmessageutils.jl/lists"}