Skip to content

Commit edf356f

Browse files
committed
Update Nebulex
1 parent 76d2e4e commit edf356f

File tree

7 files changed

+21
-25
lines changed

7 files changed

+21
-25
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ jobs:
6060
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{
6161
hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
6262
restore-keys: |
63-
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-
63+
${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-build-${{
64+
hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
6465
6566
- name: Install Dependencies
6667
run: |

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@
1212
See the [online documentation](https://hexdocs.pm/nebulex_adapters_cachex/)
1313
for more information.
1414

15+
> **NOTE:** This adapter only supports Nebulex v2.0.0 onwards.
16+
1517
## Installation
1618

1719
Add `:nebulex_adapters_cachex` to your list of dependencies in `mix.exs`:
1820

1921
```elixir
2022
def deps do
2123
[
22-
{:nebulex_adapters_cachex, "~> 1.0"}
24+
{:nebulex_adapters_cachex, "~> 2.0"}
2325
]
2426
end
2527
```
@@ -104,7 +106,7 @@ end
104106
```
105107

106108
> See [Cachex.start_link/1][cachex_start_link] for more information
107-
about options.
109+
about the options.
108110

109111
[cachex_start_link]: https://hexdocs.pm/cachex/Cachex.html#start_link/1
110112

lib/nebulex/adapters/cachex.ex

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ defmodule Nebulex.Adapters.Cachex do
44
55
[Cachex]: http://hexdocs.pm/cachex/Cachex.html
66
7-
This adapter allows to use Cachex (a widely used and powerful cache in Elixir)
8-
via Nebulex, which means, you can use Nebulex as usual taking advantage of all
9-
its benefits (e.g.: cache abstraction layer, distributed caching topologies,
10-
declarative caching annotations, and so on), and at the same time using Cachex
11-
as cache backend.
7+
By means of this adapter, you can configure Cachex as the cache backend
8+
and use it through the Nebulex API.
129
1310
## Options
1411
@@ -129,7 +126,7 @@ defmodule Nebulex.Adapters.Cachex do
129126
130127
> **NOTE:** You could also use [NebulexRedisAdapter][nbx_redis_adapter] for
131128
L2, it would be matter of changing the adapter for the L2 and the
132-
configuration for set up Redis adapter.
129+
configuration to set up Redis adapter.
133130
134131
[nbx_redis_adapter]: https://github.com/cabol/nebulex_redis_adapter
135132
@@ -383,8 +380,6 @@ defmodule Nebulex.Adapters.Cachex do
383380
@impl true
384381
def stats(%{name: name, stats: stats}) do
385382
if stats do
386-
# IO.puts "#=> Stats: #{inspect(Cachex.stats(name))}"
387-
388383
{meta, stats} =
389384
name
390385
|> Cachex.stats!()

mix.exs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ defmodule NebulexAdaptersCachex.MixProject do
22
use Mix.Project
33

44
@source_url "https://github.com/cabol/nebulex_adapters_cachex"
5-
@version "1.0.0-dev"
6-
@nbx_vsn "2.0.0-rc.2"
5+
@version "2.0.0-dev"
6+
@nbx_vsn "2.0.0"
77

88
def project do
99
[
@@ -72,16 +72,15 @@ defmodule NebulexAdaptersCachex.MixProject do
7272
if path = System.get_env("NEBULEX_PATH") do
7373
{:nebulex, "~> #{@nbx_vsn}", path: path}
7474
else
75-
# {:nebulex, "~> #{@nbx_vsn}"}
76-
{:nebulex, github: "cabol/nebulex"}
75+
{:nebulex, "~> #{@nbx_vsn}"}
7776
end
7877
end
7978

8079
defp aliases do
8180
[
8281
"nbx.setup": [
8382
"cmd rm -rf nebulex",
84-
"cmd git clone --depth 1 --branch master https://github.com/cabol/nebulex"
83+
"cmd git clone --depth 1 --branch v2.0.0 https://github.com/cabol/nebulex"
8584
],
8685
check: [
8786
"compile --warnings-as-errors",

mix.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
66
"cachex": {:hex, :cachex, "3.3.0", "6f2ebb8f27491fe39121bd207c78badc499214d76c695658b19d6079beeca5c2", [:mix], [{:eternal, "~> 1.2", [hex: :eternal, repo: "hexpm", optional: false]}, {:jumper, "~> 1.0", [hex: :jumper, repo: "hexpm", optional: false]}, {:sleeplocks, "~> 1.1", [hex: :sleeplocks, repo: "hexpm", optional: false]}, {:unsafe, "~> 1.0", [hex: :unsafe, repo: "hexpm", optional: false]}], "hexpm", "d90e5ee1dde14cef33f6b187af4335b88748b72b30c038969176cd4e6ccc31a1"},
77
"certifi": {:hex, :certifi, "2.5.3", "70bdd7e7188c804f3a30ee0e7c99655bc35d8ac41c23e12325f36ab449b70651", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "ed516acb3929b101208a9d700062d520f3953da3b6b918d866106ffa980e1c10"},
8-
"credo": {:hex, :credo, "1.5.4", "9914180105b438e378e94a844ec3a5088ae5875626fc945b7c1462b41afc3198", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cf51af45eadc0a3f39ba13b56fdac415c91b34f7b7533a13dc13550277141bc4"},
8+
"credo": {:hex, :credo, "1.5.5", "e8f422026f553bc3bebb81c8e8bf1932f498ca03339856c7fec63d3faac8424b", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "dd8623ab7091956a855dc9f3062486add9c52d310dfd62748779c4315d8247de"},
99
"deep_merge": {:hex, :deep_merge, "1.0.0", "b4aa1a0d1acac393bdf38b2291af38cb1d4a52806cf7a4906f718e1feb5ee961", [:mix], [], "hexpm", "ce708e5f094b9cd4e8f2be4f00d2f4250c4095be93f8cd6d018c753894885430"},
10-
"dialyxir": {:hex, :dialyxir, "1.0.0", "6a1fa629f7881a9f5aaf3a78f094b2a51a0357c843871b8bc98824e7342d00a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "aeb06588145fac14ca08d8061a142d52753dbc2cf7f0d00fc1013f53f8654654"},
10+
"dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},
1111
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
1212
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
1313
"eternal": {:hex, :eternal, "1.2.2", "d1641c86368de99375b98d183042dd6c2b234262b8d08dfd72b9eeaafc2a1abd", [:mix], [], "hexpm", "2c9fe32b9c3726703ba5e1d43a1d255a4f3f2d8f8f9bc19f094c7cb1a7a9e782"},
1414
"ex_doc": {:hex, :ex_doc, "0.23.0", "a069bc9b0bf8efe323ecde8c0d62afc13d308b1fa3d228b65bca5cf8703a529d", [:mix], [{:earmark_parser, "~> 1.4.0", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm", "f5e2c4702468b2fd11b10d39416ddadd2fcdd173ba2a0285ebd92c39827a5a16"},
15-
"excoveralls": {:hex, :excoveralls, "0.13.4", "7b0baee01fe150ef81153e6ffc0fc68214737f54570dc257b3ca4da8e419b812", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "faae00b3eee35cdf0342c10b669a7c91f942728217d2a7c7f644b24d391e6190"},
15+
"excoveralls": {:hex, :excoveralls, "0.14.0", "4b562d2acd87def01a3d1621e40037fdbf99f495ed3a8570dfcf1ab24e15f76d", [:mix], [{:hackney, "~> 1.16", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "94f17478b0cca020bcd85ce7eafea82d2856f7ed022be777734a2f864d36091a"},
1616
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
1717
"hackney": {:hex, :hackney, "1.17.0", "717ea195fd2f898d9fe9f1ce0afcc2621a41ecfe137fae57e7fe6e9484b9aa99", [:rebar3], [{:certifi, "~>2.5", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "64c22225f1ea8855f584720c0e5b3cd14095703af1c9fbc845ba042811dc671c"},
1818
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
@@ -22,7 +22,7 @@
2222
"makeup_elixir": {:hex, :makeup_elixir, "0.15.1", "b5888c880d17d1cc3e598f05cdb5b5a91b7b17ac4eaf5f297cb697663a1094dd", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "db68c173234b07ab2a07f645a5acdc117b9f99d69ebf521821d89690ae6c6ec8"},
2323
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},
2424
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
25-
"nebulex": {:git, "https://github.com/cabol/nebulex.git", "de11a4b0694a860ba4ce8ee42638ad982fe74494", []},
25+
"nebulex": {:hex, :nebulex, "2.0.0", "d33dc5a2b96ba09e5eb1c90e53dd1d036b0c006f1bb379bcc5c10acd0b140d6d", [:mix], [{:decorator, "~> 1.3", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.0", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "411c707e455408ae79ae7bfe7ada125967d016b83ff2a4e9763fd7cc2dd9372d"},
2626
"nimble_parsec": {:hex, :nimble_parsec, "1.1.0", "3a6fca1550363552e54c216debb6a9e95bd8d32348938e13de5eda962c0d7f89", [:mix], [], "hexpm", "08eb32d66b706e913ff748f11694b17981c0b04a33ef470e33e11b3d3ac8f54b"},
2727
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
2828
"sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},

test/nebulex_adapters_cachex/multilevel_test.exs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@ defmodule NebulexAdaptersCachex.MultilevelTest do
22
use ExUnit.Case, async: true
33
use Nebulex.NodeCase
44
use Nebulex.MultilevelTest
5-
# use Nebulex.Cache.QueryableTest
6-
# use Nebulex.Cache.TransactionTest
5+
use Nebulex.Cache.QueryableTest
6+
use Nebulex.Cache.TransactionTest
77

88
import Nebulex.CacheCase
99

10-
alias Nebulex.Time
1110
alias NebulexAdaptersCachex.TestCache.Multilevel
1211
alias NebulexAdaptersCachex.TestCache.Multilevel.{L1, L2, L3}
1312

14-
@gc_interval Time.expiry_time(1, :hour)
13+
@gc_interval :timer.hours(1)
1514

1615
@levels [
1716
{

test/shared/queryable_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Nebulex.Adapters.Cachex.QueryableTest do
22
import Nebulex.CacheCase
33

44
deftests do
5-
import Nebulex.CacheHelpers
5+
import Nebulex.CacheCase
66

77
alias Cachex.Query
88

0 commit comments

Comments
 (0)