Skip to content

Commit

Permalink
Add database name to event. Related to #400
Browse files Browse the repository at this point in the history
  • Loading branch information
FCO committed Sep 24, 2019
1 parent e3684dc commit ed4a96c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Red/Do.pm6
Expand Up @@ -103,6 +103,7 @@ proto red-do(|) {
multi red-do(*@blocks where .all ~~ Callable, Str :$with = "default", :$async) is export {
X::Red::Do::DriverNotDefined.new(:driver($with)).throw unless %GLOBAL::RED-DEFULT-DRIVERS{$with}:exists;
my @ret = do for @blocks {
my Str $*RED-DO-WITH = $with;
red-do :with(%GLOBAL::RED-DEFULT-DRIVERS{$with}), $_, :$async
}
if $async {
Expand Down
2 changes: 1 addition & 1 deletion lib/Red/Driver.pm6
Expand Up @@ -22,7 +22,7 @@ multi method emit($data) {
}

multi method emit(Red::Event $event) {
$!supplier.emit: $event.clone: :db(self), :db-name(self.^name)
$!supplier.emit: $event.clone: :db(self), :db-name(self.^name), |(:db-name($_) with $*RED-DO-WITH)
}

method schema-reader(--> Red::SchemaReader) { ... }
Expand Down

0 comments on commit ed4a96c

Please sign in to comment.