Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client server article #17

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6a6f054
Initial setup
RoboDoig Mar 9, 2023
04b683c
modify docgf.json for API build
RoboDoig Mar 10, 2023
4e9aa4c
Basic client text
RoboDoig Mar 10, 2023
4d9f548
Add example workflow
RoboDoig Mar 10, 2023
3ba8a5c
Clients and router message parsing
RoboDoig Mar 16, 2023
9b742e0
Client address tracking
RoboDoig Mar 16, 2023
d4882fd
Server-->client and SelectMany detour
RoboDoig Mar 16, 2023
be73aee
docs up to Dealer bug
RoboDoig Mar 23, 2023
e3afe60
Change version to 0.1.1
RoboDoig Mar 23, 2023
e911ea3
Leave one out broadcast
RoboDoig May 18, 2023
6f6e07b
Update xrefs for all referenced nodes
RoboDoig May 18, 2023
b95a8d9
Add initial dealer workflow
RoboDoig Jan 13, 2025
b9e7e77
Fix typos in xrefs
RoboDoig Jan 13, 2025
fe65c46
Remove layouts and svgs
RoboDoig Jan 14, 2025
fd6fd9d
Add to tutorials subsection
RoboDoig Jan 16, 2025
48fcd3b
Add windows input package to local bonsai environment
RoboDoig Jan 16, 2025
0c7c820
Reformat operator references
RoboDoig Jan 16, 2025
097ce49
Reformat workflow action points as bullet points
RoboDoig Jan 16, 2025
07f2ad2
Replace references to 'node' with 'operator'
RoboDoig Jan 16, 2025
75f5a15
Refer to router-dealer pattern with explicit link
RoboDoig Jan 16, 2025
485e8c7
Break up final section of SelectMany detour
RoboDoig Jan 17, 2025
ebc2528
Move client-server article to new tutorial section
RoboDoig Jan 17, 2025
00cf0ff
Clean up content definition for tutorials in docfx.json
RoboDoig Jan 17, 2025
0af7e4a
Fix some typos
RoboDoig Jan 23, 2025
4ecd0f2
Step section for BounceBack SelectMany
RoboDoig Jan 24, 2025
1070ee0
Remove redundant information about source subject creation
RoboDoig Jan 24, 2025
f957e36
Reformat SelectMany explanation
RoboDoig Jan 24, 2025
f93dc41
Fix typo
RoboDoig Jan 24, 2025
fa0a8ff
Create extra step breakout for SelectMany detour
RoboDoig Jan 24, 2025
3576b55
Clarify purpose of replacing SendResponse operator
RoboDoig Jan 29, 2025
6e59042
Further explanation for BounceBack operator
RoboDoig Jan 29, 2025
8cb89d0
Add inside peek to BounceBack operator
RoboDoig Jan 29, 2025
ecb08e8
Add zeromq dependency to local environment and add bounceback workflow
RoboDoig Jan 29, 2025
e8895e7
Clearer bounceback explanation
RoboDoig Jan 29, 2025
d0f8e95
Avoid redundant explanation from step breakout
RoboDoig Jan 29, 2025
463c767
Ignore and stop tracking bonsai .exe.settings
RoboDoig Jan 30, 2025
c326648
Revert bonsai.config to exclude ZeroMQ and dependencies
RoboDoig Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bonsai/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.exe
*.exe.settings
Packages/
3 changes: 3 additions & 0 deletions .bonsai/Bonsai.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Package id="Bonsai.Osc" version="2.7.0" />
<Package id="Bonsai.System" version="2.8.1" />
<Package id="Bonsai.Vision" version="2.8.1" />
<Package id="Bonsai.Windows.Input" version="2.7.0" />
<Package id="jacobslusser.ScintillaNET" version="3.6.3" />
<Package id="Markdig" version="0.18.1" />
<Package id="Microsoft.Web.WebView2" version="1.0.1823.32" />
Expand All @@ -29,6 +30,7 @@
<AssemblyReference assemblyName="Bonsai.Osc" />
<AssemblyReference assemblyName="Bonsai.System" />
<AssemblyReference assemblyName="Bonsai.Vision" />
<AssemblyReference assemblyName="Bonsai.Windows.Input" />
</AssemblyReferences>
<AssemblyLocations>
<AssemblyLocation assemblyName="Bonsai" processorArchitecture="MSIL" location="Packages\Bonsai.2.8.2\lib\net48\Bonsai.exe" />
Expand All @@ -39,6 +41,7 @@
<AssemblyLocation assemblyName="Bonsai.Osc" processorArchitecture="MSIL" location="Packages\Bonsai.Osc.2.7.0\lib\net462\Bonsai.Osc.dll" />
<AssemblyLocation assemblyName="Bonsai.System" processorArchitecture="MSIL" location="Packages\Bonsai.System.2.8.1\lib\net462\Bonsai.System.dll" />
<AssemblyLocation assemblyName="Bonsai.Vision" processorArchitecture="MSIL" location="Packages\Bonsai.Vision.2.8.1\lib\net462\Bonsai.Vision.dll" />
<AssemblyLocation assemblyName="Bonsai.Windows.Input" processorArchitecture="MSIL" location="Packages\Bonsai.Windows.Input.2.7.0\lib\net462\Bonsai.Windows.Input.dll" />
<AssemblyLocation assemblyName="Markdig" processorArchitecture="MSIL" location="Packages\Markdig.0.18.1\lib\net40\Markdig.dll" />
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.Core" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.Core.dll" />
<AssemblyLocation assemblyName="Microsoft.Web.WebView2.WinForms" processorArchitecture="MSIL" location="Packages\Microsoft.Web.WebView2.1.0.1823.32\lib\net45\Microsoft.Web.WebView2.WinForms.dll" />
Expand Down
9 changes: 7 additions & 2 deletions docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"src": [
{
"files": [
"Bonsai.ZeroMQ/*.csproj"
"Bonsai.ZeroMQ/Bonsai.ZeroMQ.csproj"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to specify the .csproj file name directly? There shouldn't be more than one file at this location, or could it be perhaps a backup? I usually have this convention to avoid having to type the name of the project twice, but maybe there is a good reason to be more explicit.

],
"src": "../src"
}
Expand All @@ -31,6 +31,12 @@
"*.md"
]
},
{
"files": [
"tutorials/**.md",
"tutorials/toc.yml"
]
},
{
"exclude": [
"_site/**",
Expand Down Expand Up @@ -64,7 +70,6 @@
"_enableNewTab": true,
"_enableSearch": true,
"_gitContribute": {
"repo": "https://github.com/bonsai-rx/zeromq",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to remove the explicit repo URL? Reading the docfx docs it seems like docfx does use automatically the current repo if it is not specified, so maybe there isn't a need to have it, but just confirming.

If we do go for this, it might be better to make this change in a separate PR, just to avoid mixing unrelated configuration changes from the article development.

"branch": "main",
"apiSpecFolder": "docs/apidoc"
}
Expand Down
2 changes: 2 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
href: articles/
- name: Reference
href: api/
- name: Tutorials
href: tutorials/
230 changes: 230 additions & 0 deletions docs/tutorials/client-server.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/tutorials/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- name: Tutorials
- href: client-server.md
100 changes: 100 additions & 0 deletions docs/workflows/address-kvp.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zmq="clr-namespace:Bonsai.ZeroMQ;assembly=Bonsai.ZeroMQ"
xmlns:wie="clr-namespace:Bonsai.Windows.Input;assembly=Bonsai.Windows.Input"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Router">
<zmq:ConnectionString>@tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Request.First</Selector>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Buffer</Selector>
</Expression>
<Expression xsi:type="Index">
<Operand xsi:type="IntProperty">
<Value>1</Value>
</Operand>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Zip" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Request.Last</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:ConvertToString" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D1</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D2</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client2</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D3</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client3</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="0" To="5" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="2" To="4" Label="Source2" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source1" />
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="13" To="14" Label="Source1" />
<Edge From="14" To="15" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
109 changes: 109 additions & 0 deletions docs/workflows/address-replay-subject.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:zmq="clr-namespace:Bonsai.ZeroMQ;assembly=Bonsai.ZeroMQ"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:wie="clr-namespace:Bonsai.Windows.Input;assembly=Bonsai.Windows.Input"
xmlns="https://bonsai-rx.org/2018/workflow">
<Workflow>
<Nodes>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Router">
<zmq:ConnectionString>@tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Request.First</Selector>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Buffer</Selector>
</Expression>
<Expression xsi:type="Index">
<Operand xsi:type="IntProperty">
<Value>1</Value>
</Operand>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Zip" />
</Expression>
<Expression xsi:type="rx:DistinctBy">
<rx:KeySelector>Item1</rx:KeySelector>
</Expression>
<Expression xsi:type="rx:ReplaySubject">
<Name>ClientAddresses</Name>
<rx:BufferSize xsi:nil="true" />
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Request.Last</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:ConvertToString" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D1</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D2</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client2</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="wie:KeyDown">
<wie:Filter>D3</wie:Filter>
<wie:SuppressRepetitions>false</wie:SuppressRepetitions>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="StringProperty">
<Value>Client3</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="zmq:Dealer">
<zmq:ConnectionString>tcp://localhost:5557</zmq:ConnectionString>
</Combinator>
</Expression>
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="0" To="7" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="2" To="4" Label="Source2" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="11" Label="Source1" />
<Edge From="12" To="13" Label="Source1" />
<Edge From="13" To="14" Label="Source1" />
<Edge From="15" To="16" Label="Source1" />
<Edge From="16" To="17" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
Loading