Skip to content

Commit

Permalink
Enable event-stream by default for DwnApi. (#910)
Browse files Browse the repository at this point in the history
* enable event stream
  • Loading branch information
LiranCohen authored Sep 26, 2024
1 parent 91ae997 commit d3b4728
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-lions-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@web5/api": patch
---

Enable EventStream from agent.
8 changes: 8 additions & 0 deletions .changeset/rude-socks-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@web5/agent": patch
"@web5/identity-agent": patch
"@web5/proxy-agent": patch
"@web5/user-agent": patch
---

Enable EventEmitterStream
3 changes: 3 additions & 0 deletions packages/agent/src/dwn-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
DwnConfig,
DwnInterfaceName,
DwnMethodName,
EventEmitterStream,
EventLogLevel,
GenericMessage,
Message,
Expand Down Expand Up @@ -156,6 +157,8 @@ export class AgentDwnApi {

resumableTaskStore ??= new ResumableTaskStoreLevel({ location: `${dataPath}/DWN_RESUMABLETASKSTORE` });

eventStream ??= new EventEmitterStream();

return await Dwn.create({ dataStore, didResolver, eventLog, eventStream, messageStore, tenantGate, resumableTaskStore });
}

Expand Down

0 comments on commit d3b4728

Please sign in to comment.