Skip to content

Instantly share code, notes, and snippets.

@beerose
Created August 28, 2018 21:01
Show Gist options
  • Save beerose/6de75766b0e8881896fea91cabbcc867 to your computer and use it in GitHub Desktop.
Save beerose/6de75766b0e8881896fea91cabbcc867 to your computer and use it in GitHub Desktop.
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