Initial commit
This commit is contained in:
17
tests/ephemeral-transport.ts
Normal file
17
tests/ephemeral-transport.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { EphemeralTransport } from '../src/transports/ephemeral-transport.js';
|
||||
import { TransportComposite } from '../src/transports/transport-composite.js';
|
||||
|
||||
import { TransportSSE } from '../src/transports/transport-sse.js';
|
||||
|
||||
const composite = async (url: string) =>
|
||||
TransportComposite.from(
|
||||
await Promise.all([TransportSSE.from(url), TransportSSE.from(url)]),
|
||||
);
|
||||
|
||||
const ephemeral = EphemeralTransport.from(composite);
|
||||
|
||||
const message = await ephemeral.receive(
|
||||
'https://oracles.generalprotocols.com/sse/v1/messages',
|
||||
);
|
||||
|
||||
console.log(message);
|
||||
Reference in New Issue
Block a user