imp(messaging): replaced #createMicroservice #run method with thunk
MODIFY
packages/@integration/src/messaging/server.ts
packages/@integration/src/messaging/server.ts
@@ -86,5 +86,5 @@ export const microservice = createMicroservice({
});
if (process.env.NODE_ENV !== 'test') {
- microservice.run();
+ microservice();
}

MODIFY
packages/@integration/test/messaging.integration.spec.ts
packages/@integration/test/messaging.integration.spec.ts
@@ -2,7 +2,7 @@ import * as request from 'supertest';
import { server as httpServer } from '../src/messaging/client';
import { microservice as messagingServer } from '../src/messaging/server';
-const microservice = messagingServer.run();
+const microservice = messagingServer();
beforeAll(() => microservice);

MODIFY
packages/messaging/README.md
packages/messaging/README.md
@@ -55,7 +55,7 @@ export const microservice = createMicroservice({
}),
});
-microservice.run();
+microservice();
```
Messaging client supports two communication patterns:

MODIFY
packages/messaging/src/server/messaging.server.spec.ts
packages/messaging/src/server/messaging.server.spec.ts
@@ -22,7 +22,7 @@ describe('messagingServer', () => {
options,
transport: Transport.AMQP,
messagingListener: messagingListener(effect$ ? { effects: [effect$], error$ } : undefined),
- }).run();
+ })();
const runClient = () =>
createAmqpStrategy(options).connect({ isConsumer: false });

MODIFY
packages/messaging/src/server/messaging.server.ts
packages/messaging/src/server/messaging.server.ts
@@ -28,7 +28,5 @@ export const createMicroservice = (config: CreateMicroserviceConfig) => {
event$(serverEvent$, undefined, metadata).subscribe();
}
- return {
- run: listenerWithContext.listen,
- };
+ return listenerWithContext.listen;
};

MODIFY
packages/messaging/tsconfig.json
packages/messaging/tsconfig.json
"declaration": true,
"typeRoots": ["../../node_modules/@types"]
},
- "include": ["src/**/*.ts"],
+ "include": ["src/**/*.ts"]
}

imp(messaging): replaced #createMicroservice #run method with thunk