Skip to content

Use generated groups, and publish/subscribe from a task, in the Julia examples - #48

Open
tsaubergine wants to merge 3 commits into
mainfrom
claude/julia-task-pubsub
Open

Use generated groups, and publish/subscribe from a task, in the Julia examples#48
tsaubergine wants to merge 3 commits into
mainfrom
claude/julia-task-pubsub

Conversation

@tsaubergine

@tsaubergine tsaubergine commented Aug 19, 2026

Copy link
Copy Markdown
Member

Two changes to the Julia examples. The second needs GobySoft/goby3#413.

Name groups through the generated module

goby_add_julia_app() writes a module beside each application with a constant per group and an accessor per portal, but the examples still repeated the interface.yml expression as a string:

Goby.publish(app, Goby.INTERPROCESS, "groups::julia_nav", nav)

They now include that module and name the group through it:

include(joinpath(@__DIR__, "basic_julia_publisher_goby.jl"))
using .BasicJuliaPublisherGoby: groups, interprocess

Goby.publish(app, interprocess(), groups.julia_nav, nav)

The expression then lives in one place, and a mistyped group is an UndefVarError naming it rather than a GOBY_JULIA_FAIL that terminates the application once the publish is reached.

Publish and subscribe from a task in the multithread example

The example was written when INTERPROCESS was reachable only from Main, and its header said so — publishing from a task raised an AssertionError. With GobySoft/goby3#413 that is no longer true, so the example now shows what the layer actually offers:

  • the subscriber task publishes deep reports to INTERPROCESS itself, rather than handing them to Main over INTERTHREAD
  • the publisher task subscribes to the same group from its own thread

Main keeps the INTERTHREAD depth-alert subscription, which is still where the "an interthread message can be any Julia value" point lives (the alert is a NamedTuple). interface.yml gains the matching subscribes entry.

Verified against a live gobyd: each deep report reaches both the separate basic_julia_subscriber process and the publisher task, exactly once.

[publisher] Tx: z=-300.1
[subscriber] Rx: z=-300.1
[main] alert: 300.1 m at x=98.2 y=213.1
[publisher] on the wire: z=-300.1

The publisher/subscriber pair was re-run too, to check the generated-module change on its own.

Note on CI

This job installs libgoby3-dev and goby3-julia from the continuous package repo and only builds, so its green proves the Julia examples compile — including the new subscribes entry generating valid C++ — not that the multithread example runs. That needs #413 merged and the continuous package rebuilt; the runtime evidence above is from a local build of that branch.

claude added 3 commits August 19, 2026 04:54
goby_add_julia_app() writes a module beside each application with a constant
per group and an accessor per portal, so the scripts no longer repeat the
interface.yml expression as a string.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nsf4QMNTfUxkyWh4xGaok
The subscriber task now sends deep reports to interprocess itself rather than
handing them to Main, and the publisher task subscribes to the same group from
its own thread. Both were restrictions of Goby.jl rather than of the layer.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nsf4QMNTfUxkyWh4xGaok
A group the generated C++ has no case for hits GOBY_JULIA_FAIL, which logs at
glog's die level and terminates the application. The README claimed a typo was
otherwise a message that goes nowhere; nothing was going nowhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016nsf4QMNTfUxkyWh4xGaok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants