Skip to content

Commit

Permalink
Add ResolveStreamUrl option to match TypeScript ServerEventsClient
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 21, 2018
1 parent ada5815 commit 7adcf67
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/ServiceStack.Client/ServerEventsClient.cs
Expand Up @@ -96,8 +96,7 @@ public partial class ServerEventsClient : IDisposable

public string ConnectionDisplayName => ConnectionInfo != null ? ConnectionInfo.DisplayName : "(not connected)";

public string EventStreamPath { get; set; }
public string EventStreamUri { get; private set; }
public Func<string, string> ResolveStreamUrl { get; set; }

public string BaseUri
{
Expand Down Expand Up @@ -133,6 +132,15 @@ private void BuildEventStreamUri()
.AddQueryParam("channels", string.Join(",", this.channels));
}

public string EventStreamPath { get; set; }

private string eventStreamUri;
public string EventStreamUri
{
get => ResolveStreamUrl != null ? ResolveStreamUrl(eventStreamUri) : eventStreamUri;
private set => eventStreamUri = value;
}

public IServiceClient ServiceClient { get; set; }
public DateTime LastPulseAt { get; set; }

Expand Down Expand Up @@ -566,6 +574,7 @@ public void ProcessResponse(Stream stream)
}

private ServerEventMessage currentMsg;

void ProcessLine(string line)
{
if (line == null) return;
Expand Down

0 comments on commit 7adcf67

Please sign in to comment.