Giter Site home page Giter Site logo

Comments (8)

Nhowka avatar Nhowka commented on July 19, 2024 1

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.

Alkasai avatar Alkasai commented on July 19, 2024

Same

from elmish.bridge.

Alkasai avatar Alkasai commented on July 19, 2024

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.

Nhowka avatar Nhowka commented on July 19, 2024

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.

Alkasai avatar Alkasai commented on July 19, 2024

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.

Nhowka avatar Nhowka commented on July 19, 2024

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.

Alkasai avatar Alkasai commented on July 19, 2024

Thank you! Will give it a try.

from elmish.bridge.

Alkasai avatar Alkasai commented on July 19, 2024

Seems to be working. Thank you again, for the prompt fix!

from elmish.bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.