Comments (6)
Thanks for a the bug report. I'll test what happens when you force a recompile (mix compile --force
) and add a note to the README if that solves the issue. It's unlikely that a user will swap event store providers more than once after initial setup. The macro provides convenient, and quick, access to the module.
from commanded.
I think you could quote this code. It should be equally fast (as it will be evaluated at compiletime as well) but the expansion will happen at compiletime of the module that uses Commanded.EventStore
. But thats guesswork now :D
from commanded.
Yes, that's exactly what it should be doing. Thanks for the pointer, want to submit a pull request with the change ;-)
from commanded.
I tried it locally, sadly my (poor) understanding of the macro system let to no improvement on this.
from commanded.
That's a shame, not to worry though. I'll take a look.
from commanded.
I've done some testing on this issue. It appears to be ok if you force a recompile of Commanded after making the config change.
To verify, I added logging to the Commanded.EventStore
macro to output the configured adapter:
defmodule Commanded.EventStore do
defmacro __using__(_) do
adapter = Application.get_env(:commanded, :event_store_adapter) || raise ArgumentError, "Commanded expects :event_store_adapter to be configured in environment"
IO.puts "event store adapter: #{inspect adapter}"
quote do
@event_store unquote(adapter)
end
end
end
Then I configured my app to use the in-memory adapter:
$ mix deps.compile commanded --force
==> commanded
Compiling 37 files (.ex)
event store adapter: Commanded.EventStore.Adapters.InMemory
...
I changed the config in my app to use the event store adapter and forced a recompile:
$ mix deps.compile commanded --force
==> commanded
Compiling 37 files (.ex)
event store adapter: Commanded.EventStore.Adapters.EventStore
...
So given that outcome, I've updated the README to include the above force recompile step when installing, or changing between, event store adapters.
from commanded.
Related Issues (20)
- Commanded.aggregate_state does not work when aggregate identity has a prefix HOT 10
- Process manager router option not working
- Lessons learned from performance optimization - an unlikely culprit HOT 3
- no function clause matching in Commanded.Commands.Dispatcher.telemetry_stop/3 HOT 1
- Docs questions
- Stacktrace in event handler error? HOT 2
- Paralelization Strategies in EventHandlers
- Should Commanded.Event.Handler support messages from swarm? HOT 2
- Event retention policies?
- please support multiple commanded application with one eventstore HOT 6
- Process Manager state serialization breaks when using a custom TypeProvider with the JsonSerializer
- `Commanded.ProcessManagers.ProcessManager.identity/0` function returns `nil` in unit tests
- no function clause matching in Commanded.Event.Handler.partition_event/4 HOT 1
- EventstoreDB is sunsetting the TCP protocol HOT 1
- Is it a bad practice for an event handler to depend on a projector completion? HOT 2
- Snapshotting 2 Aggregates having same identity
- Is it possible to log contents of InMemoryEventStore on failed test?
- Ecto Sandbox, Projections and In Memory adapter HOT 3
- Aggregate throws error when execute returns more than 1000 events.
- Individual stream events handling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commanded.