Skip to content

Commit

Permalink
Fixed incompatiblity with Couchie.Transcoder and Jazz.
Browse files Browse the repository at this point in the history
  • Loading branch information
n1rvana committed Aug 23, 2014
1 parent 8aa2d50 commit 2a12ea8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 38 deletions.
46 changes: 13 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,30 @@ Note: to build, you need to have libcouchbase installed.
brew install libcouchbase

### Example
(this is a bit obsolete)

```
$ iex -S mix
Erlang R16B (erts-5.10.1) [source-05f1189] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (0.8.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Couchie.open(:default)
{:ok,#PID<0.63.0>}
iex(2)> Couchie.set(:default, "3-18-13-6-57", "value")
:ok
iex(3)> Couchie.get(:default, "3-18-13-6-57")
{"3-18-13-6-57",16538602597327634432,"value"}
iex(5)> Couchie.set(:default, "3-18-13-7-07", [:a, :b, :c])
:ok
iex(6)> Couchie.get(:default, "3-18-13-7-07")
{"3-18-13-7-07",11380463241031450624,["a","b","c"]}
iex(7)> Couchie.open(:cache, 10, 'localhost:8091', 'cache', 'cache')
{:ok,#PID<0.77.0>}
iex(8)> Couchie.set(:cache, "3-18-13-7-11", "test value")
:ok
iex(9)> Couchie.set(:cache, "3-18-13-7-12", ["a", 'b'], 10)
:ok
# more than ten seconds later...
iex(10)> Couchie.get(:cache, "3-18-13-7-12")
{"3-18-13-7-12",{:error,:key_enoent}} #key has expired from memcached bucket.
iex(11)> Couchie.get(:cache, "3-18-13-7-11")
{"3-18-13-7-11",72057594037927936,"test value"}
iex(12)> Couchie.set(:cache, "3-18-13-7-12", ["a", 'b'], 100)
iex(1)> Couchie.open(:d)
Opening d, 10, localhost:8091
Opening d, 10, localhost:8091, , ,
Opened d, 10, localhost:8091
:ok
iex(13)> Couchie.get(:cache, "3-18-13-7-12")
{"3-18-13-7-12",216172782113783808,["a",'b']}
# Storing data structures, like a HashDict
iex(14)> bar = HashDict.new
#HashDict<[]>
iex(15)> bar = bar |> HashDict.put("key", "value")
#HashDict<[{"key", "value"}]>
iex(16)> Couchie.set(:default, "bar", bar)
iex(2)> Couchie.set(:d, "foo", %{foo: "bar"})
:ok
iex(17)> Couchie.get(:default, "bar")
{"bar", 983466356890402816, #HashDict<[{"key", "value"}]>}
iex(3)> Couchie.get(:d, "foo")
{"foo", 10812679138524069888, %{foo: "bar"}}
iex(4)>
```

## Simple support for cberl views"
```
Couchie.open(:beer, 10, 'cb.server.w.beer.sample:8091', 'beer-sample', 'beer-sample', '')
Couchie.query(:beer, 'beer', 'brewery_beers', [{:limit, 10}])
```

##Current functionality
- Basic commands: Set, Get, MGet, Delete
Expand Down
3 changes: 2 additions & 1 deletion lib/transcoder.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule Couchie.Transcoder do
require Bitwise

use Jazz

@cbe_json 0x02
@cbe_raw 0x04
@cbe_str 0x08
Expand Down
4 changes: 1 addition & 3 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ defmodule Couchie.Mixfile do
@doc "Project Details"
def project do
[ app: :couchie,
version: "0.0.1",
version: "0.0.6",
deps: deps ]
end

@doc "Configuration for the OTP application"
def application do
[
applications: [:cberl] #, :ibrowse
Expand All @@ -25,7 +24,6 @@ defmodule Couchie.Mixfile do
defp deps do
[
{:cberl, github: "chitika/cberl"}, #chitika is authoritative source
#{:jazz, github: "devinus/jazz", branch: "0.13"}
{:jazz, github: "meh/jazz"}
]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%{"cberl": {:git, "git://github.com/chitika/cberl.git", "00c4a4b2b9a7f5054f69303b0be64a5266e8de3a", []},
"jazz": {:git, "git://github.com/meh/jazz.git", "e0cf73011f64868534cd229c458e205ce04a6619", []},
"jiffy": {:git, "https://github.com/davisp/jiffy.git", "2dbf89f51c547914e994f51457140df9e9a1ca83", [branch: "master"]},
"jiffy": {:git, "https://github.com/davisp/jiffy.git", "5cd89c1eda3801bdef790b1e7c0e09259332c0fc", [branch: "master"]},
"poolboy": {:git, "https://github.com/devinus/poolboy.git", "17d1582533af5c076117e2e1270f4b43faa02f12", [branch: "master"]}}

0 comments on commit 2a12ea8

Please sign in to comment.