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

Q: Initiate a message from server to client(s) #200

Open
KingKnecht opened this issue Jan 4, 2021 · 2 comments
Open

Q: Initiate a message from server to client(s) #200

KingKnecht opened this issue Jan 4, 2021 · 2 comments

Comments

@KingKnecht
Copy link

KingKnecht commented Jan 4, 2021

I'm trying to figure out how I could send messages from the server to clients. I have searched the issues here and found some topics about SignalR, but I have no idea how to do that nor if it is possible at all at the moment.

My example is the book list from the template. I can remove a book by its ISBN and I want other clients to have the modified list of books in sync.

There is BookService with following function:

removeBookByIsbn = ctx.Authorize <| fun isbn -> async {
    books.RemoveAll(fun b -> b.isbn = isbn) |> ignore
    //How to inform clients that the list has changed?
}

Thx

@JaggerJo
Copy link

JaggerJo commented Jan 7, 2021

Hi @KingKnecht,

take a look at this sample - it shows how to properly setup a SignalR Hub for broadcasting.

https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-tutorial-build-blazor-server-chat-app

@srid
Copy link

srid commented Mar 22, 2021

Is there a Bolero project template that uses SignalR for real-time communication (not just one-way broadcast) between server and client rather than XHR requests?

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

No branches or pull requests

3 participants