(tab: number[])
| 65 | @HttpCode(200) |
| 66 | concurrent(@Body() data: number[][]): Promise<boolean> { |
| 67 | const send = async (tab: number[]) => { |
| 68 | const expected = tab.reduce((a, b) => a + b); |
| 69 | const result = await lastValueFrom( |
| 70 | this.client.send<number>({ cmd: 'sum' }, tab), |
| 71 | ); |
| 72 | |
| 73 | return result === expected; |
| 74 | }; |
| 75 | return data |
| 76 | .map(async tab => send(tab)) |
| 77 | .reduce(async (a, b) => (await a) && b); |
no outgoing calls