Created
August 28, 2018 21:01
-
-
Save beerose/6de75766b0e8881896fea91cabbcc867 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Chatty.ChatService.Server do | |
use GRPC.Server, service: Chatty.ChatService.Service | |
def send_message(request, _stream) do | |
Chatty.ChatState.put_message(request.chat_message) | |
Chatty.SendMessageReply.new() | |
end | |
def fetch_messages(_request, _stream) do | |
messages = Chatty.ChatState.get_messages() | |
Chatty.FetchMessagesReply.new(messages: messages) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment