Skip to content

Commit

Permalink
Merge pull request #102 from Beans-BV/feature/stream-custom-jwt
Browse files Browse the repository at this point in the history
Forwarded http client to EventSource
  • Loading branch information
christian-rogobete authored Oct 4, 2024
2 parents 03d42f3 + c6b944f commit a3a8558
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 9 deletions.
5 changes: 4 additions & 1 deletion lib/src/requests/accounts_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ class AccountsRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/effects_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ class EffectsRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/ledgers_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ class LedgersRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/offers_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ class OffersRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/operations_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ class OperationsRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/order_book_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class OrderBookRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/payments_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ class PaymentsRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/trades_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ class TradesRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down
5 changes: 4 additions & 1 deletion lib/src/requests/transactions_request_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ class TransactionsRequestBuilder extends RequestBuilder {
return;
}
source?.close();
source = await EventSource.connect(this.buildUri());
source = await EventSource.connect(
this.buildUri(),
client: httpClient,
);
source!.listen((Event event) async {
if (cancelled) {
return null;
Expand Down

0 comments on commit a3a8558

Please sign in to comment.