Skip to main content

Webda v4

The motivation behind v4 is to provide more documentation, a new Eventing system based on cloudevents, a new Cache system.

The number of breaking changes should mostly concerns the events.

Core

  • Application: define the services, models
  • Core: create and manage the services it is available as a singleton in the application Core.get()

Default services:

  • ConfigurationService
  • CryptoService
  • Registry
  • EventService
  • SessionManager
  • Logger?

Default services are considered as core services and are always available in the application.

Entrypoints

Once the application is created, you can expose it through

REST API GraphQL Websocket GRPC

EventService

We are not using the NodeJS event anymore as events through your application can flow between different micro-services, instances of the application, etc.

The EventService is based on the CloudEvents specification and is used to emit and listen to events.

To emit an event just do:

// To emit without waiting for the event to be processed
new MyEvent(...).emit(true);
// or if the event requires to be processed
await new MyEvent(...).emit();

To listen to an event, you create a CloudEvents subscription: