Comments (8)
I'm thinking that the Elmish ring buffer is not friendly when using multiple threads. I'll check the issues with it and probably revert it to using a MailboxProcessor again.
from elmish.bridge.
Same
from elmish.bridge.
Do you know when you are planning to do this? Do you need any help?
I'm not familiar with the code-base, but who knows maybe I can help with anything.
from elmish.bridge.
A minimal repro code for the issue would be excellent. I tried to look at it earlier today, but only the stack trace didn't give me much information to understand the problem's root cause.
from elmish.bridge.
For sure.
- I start one client subscribes, which receives tons of messages (10s of messages per second) from the server.
- The messages from the server are sent using
hub.SendClientIf(fun client -> client.id = id)
- I wait for a few minutes and everything is working fine.
- Next I start a second client, which also receives messages from server using
hub.SendClientIf(fun client -> client.id = id)
- After a few minutes
hub.SendClientIf(fun client -> client.id = id)
throws exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Elmish.RingBuffer`1.Pop()
at [email protected](msg msg)
at Microsoft.FSharp.Core.OptionModule.Iterate[T](FSharpFunc`2 action, FSharpOption`1 option) in D:\a\_work\1\s\src\fsharp\FSharp.Core\option.fs:line 50
at [email protected](a arg10)
at Server.subscriberClientMsgFn(SubscriberId sId, ServerToClientMessage yieldedMsg) in C:\Users\.....\Server.fs:line 30```
from elmish.bridge.
I'm uploading version 6.0.3, which uses a MailboxProcessor to control the access to the Elmish dispatcher, hopefully fixing the problem with multi-threading.
from elmish.bridge.
Thank you! Will give it a try.
from elmish.bridge.
Seems to be working. Thank you again, for the prompt fix!
from elmish.bridge.
Related Issues (20)
- Fable.SimpleJson stringify error in Bridge.Sender HOT 11
- Server fails to deserialize client's message if it includes List<'T> HOT 8
- ValLinkagePartialKe(set_onclose) error building without Fable HOT 1
- Order of broadcast messages HOT 1
- Doesn't work with Giraffe 6, .NET 6 HOT 2
- DotnetClient reply channel type not compatible with exn
- DotnetClient stops getting server messages after using AskServer HOT 5
- BroadcastServer doesn't work HOT 4
- Collection was modified; enumeration operation may not execute
- WebSocket is invalid State HOT 1
- Update to Elmish v4 HOT 4
- V4 subscription additions HOT 1
- Client's bridge removes the program's other subscriptions HOT 1
- Update to Fable.Browser.Url 1.3.2 HOT 3
- [Question] shorten form of `Bridge.AskServer` HOT 2
- Would reply channels create memory leaks if they are dropped? HOT 4
- How to handle connections to different websocket servers? HOT 2
- Dom memory Leak HOT 1
- Sending messages to Elmish update on the server locally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elmish.bridge.