riptide v0.5.0-beta6 Riptide View Source
Riptide is a data first framework for building realtime applications. Riptide makes building snappy, realtime applications a breeze by letting you think purely in terms of your data and functionally about what should happen when it changes.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Convience method to apply a mutation that deletes a single path
The same as delete/2
but raises an exception if it fails
Convience method to apply a mutation that merges a single value
The same as merge/3
but raises an exception if it fails
Apply a mutation. This will do following steps in order
The same as mutation/2
but raises an exception if it fails
Pass in a query and get the results.
Return data under a specific path
The same as query_path/3
but raises an exception if it fails
Starts a Riptide process.
Return a stream of values underneath a path
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Convience method to apply a mutation that deletes a single path
Examples
iex> Riptide.delete(["foo", "bar"])
{:ok, %{
delete: %{
"foo" => %{
"bar" => 1
}
},
delete: %{}
}}
The same as delete/2
but raises an exception if it fails
Convience method to apply a mutation that merges a single value
Examples
iex> Riptide.merge(["foo", "bar"], "hello")
{:ok, %{
merge: %{
"foo" => %{
"bar" => "hello
}
},
delete: %{}
}}
The same as merge/3
but raises an exception if it fails
mutation(mut, state \\ %{internal: true})
View Sourcemutation(Riptide.Mutation.t(), any()) :: {:ok, Riptide.Mutation.t()} | {:error, any()}
Apply a mutation. This will do following steps in order
- Trigger
Riptide.Interceptor.mutation_before/4
- Trigger
Riptide.Interceptor.mutation_effect/4
- Broadcast mutation to interested processes
- Write mutation to stores
- Trigger
Riptide.Interceptor.mutation_after/4
Examples
iex> mut = Riptide.Mutation.put_merge(["foo", "bar"], "hello")
iex> Riptide.mutation(mut)
{:ok, %{
merge: %{
"foo" => %{
"bar" => "hello
}
},
delete: %{}
}}
The same as mutation/2
but raises an exception if it fails
Pass in a query and get the results.
Read more about query structure here. State parameter is optional and is passed to interceptors.
Options
:min
- Starting range of query, optional:max
- End range of query, optional:limit
- Max number of results, optional
Examples
iex> Riptide.query(%{ "todo:info" => %{} })
%{
"todo:info" => %{
"todo1" => %{
"text" => "Document riptide"
}
}
}
Return data under a specific path
Options
:min
- Starting range of query, optional:max
- End range of query, optional:limit
- Max number of results, optional
The same as query_path/3
but raises an exception if it fails
Starts a Riptide process.
Probably should not called this directly and instead should be placed inside your application's root supervisor.
Options
:port
- Optional, will override default port of12_000
Return a stream of values underneath a path
Options
:min
- Starting range of query, optional:max
- End range of query, optional:limit
- Max number of results, optional
Examples
iex> Riptide.stream(["todo:info"]) |> Enum.take(1)
[
%{"todo1", %{ "text" => "Document riptide" }}
]