Skip to content

Commit

Permalink
Added ForwardEventDispatcher (julienblin#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienblin authored Aug 27, 2018
1 parent 9102028 commit 1840d43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- CLI: generate-schemas: added -config option to specify tsconfig.json file (Fix #60)
- HttpClient: Added debug mode (Fix #62)
- Added clear() and list() to KeyValueRepository (Fix #57)
- Added ForwardEventDispatcher (Fix #63)

## [0.49.0] - 2018-08-23
### Added
Expand Down
13 changes: 13 additions & 0 deletions packages/uno-serverless/src/events/event-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,16 @@ export class LocalEventDispatcher implements EventPublisher, EventDispatcher {
}

}

/**
* Very simple EventDispatcher that forwards events to a different EventPublisher.
*/
export class ForwardEventDispatcher implements EventDispatcher {

public constructor(private readonly publisher: EventPublisher) {}

public dispatch(evt: Event): Promise<void> {
return this.publisher.publish(evt);
}

}
2 changes: 1 addition & 1 deletion packages/uno-serverless/src/events/event-publisher.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Event } from "./event";

/** EventPublisher publishes event for defered execution. */
/** EventPublisher publishes event for deferred execution. */
export interface EventPublisher {

/**
Expand Down

0 comments on commit 1840d43

Please sign in to comment.