https://github.com/markfchavez/mock_database_server
https://github.com/markfchavez/mock_database_server
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/markfchavez/mock_database_server
- Owner: MarkFChavez
- Created: 2017-07-12T22:23:01.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-12T22:32:47.000Z (about 9 years ago)
- Last Synced: 2025-02-06T15:53:10.052Z (over 1 year ago)
- Language: Elixir
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DatabaseServer
I decided not to use **GenServer**. Why? To learn how GenServer actually do it.
## Description
This is a mock database server that accepts string messages and sends it back
using a specified time interval (2 seconds at this time).
## Usage
```elixir
# start the database server
server_pid = DatabaseServer.start()
# send query to the server
DatabaseServer.send_query(server_pid, "hello world")
# get result
DatabaseServer.get_result()
```
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `database_server` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:database_server, "~> 0.1.0"}]
end
```
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/database_server](https://hexdocs.pm/database_server).