protected internal void Configure(IDictionary <string, ProviderCategoryConfiguration> providerConfigurations) { if (providerConfigurations.ContainsKey("Stream")) { var providers = providerConfigurations["Stream"]; StreamPath.Register(providers.Providers.Values); } if (serializer != null) { var instance = (IMessageSerializer)Activator.CreateInstance(serializer.Item1); instance.Init(assemblies.ToArray(), serializer.Item2 ?? new Dictionary <string, string>()); MessageEnvelope.Serializer = instance; } if (activator != null) { var instance = (IActorActivator)Activator.CreateInstance(activator.Item1); instance.Init(activator.Item2); ActorEndpoint.Activator = instance; } ActorAssembly.Register(assemblies); }
public void Dispose() { StreamPath.Reset(); MessageEnvelope.Reset(); ActorEndpoint.Reset(); ActorAssembly.Reset(); }
public StreamRef StreamOf(StreamPath path) { if (path == StreamPath.Empty) throw new ArgumentException("Stream path is empty", nameof(path)); return StreamRef.Deserialize(path); }
static object Deserialize(Type t, IDeserializationContext context) { var reader = context.StreamReader; var path = StreamPath.Parse(reader.ReadString()); var manager = context.ServiceProvider.GetRequiredService <IStreamProviderManager>(); return(new StreamRef(path, manager.GetStreamProvider(path.Provider))); }
static object Deserialize(Type t, IDeserializationContext context) { var reader = context.StreamReader; var path = StreamPath.Parse(reader.ReadString()); var provider = context.ServiceProvider.GetServiceByName <IStreamProvider>(path.Provider); return(new StreamRef(path, provider)); }
public StreamRef StreamOf(StreamPath path) { if (path == StreamPath.Empty) { throw new ArgumentException("Stream path is empty", "path"); } return(StreamRef.Deserialize(path)); }
/// <inheritdoc /> public StreamRef <TItem> StreamOf <TItem>(StreamPath path) { if (path == StreamPath.Empty) { throw new ArgumentException("Stream path is empty", nameof(path)); } var provider = serviceProvider.GetServiceByName <IStreamProvider>(path.Provider); return(new StreamRef <TItem>(path, provider)); }
/// <inheritdoc /> public StreamRef StreamOf(StreamPath path) { if (path == StreamPath.Empty) { throw new ArgumentException("Stream path is empty", nameof(path)); } var provider = StreamProviderManager.GetStreamProvider(path.Provider); return(new StreamRef(path, provider)); }
/// <summary> /// Acquires the stream reference for the given provider name and id of the stream. /// </summary> /// <param name="system">The reference to actor system</param> /// <param name="provider">The name of the stream provider</param> /// <param name="id">The id</param> /// <typeparam name="TItem">The type of the stream item</typeparam> /// <returns>A stream reference</returns> public static StreamRef <TItem> StreamOf <TItem>(this IActorSystem system, string provider, string id) { return(system.StreamOf <TItem>(StreamPath.From(provider, id))); }
protected internal StreamRef(StreamPath path) { Path = path; }
public static StreamRef Deserialize(StreamPath path) => new StreamRef(path);
public StreamRef(SerializationInfo info, StreamingContext context) { var value = (string)info.GetValue("path", typeof(string)); Path = StreamPath.Deserialize(value); }
StreamRef(StreamPath path, IAsyncStream <object> endpoint) { this.path = path; this.endpoint = endpoint; }
internal StreamRef(StreamPath path, IStreamProvider provider, IStreamRefMiddleware middleware) : this(path) { this.provider = provider; this.middleware = middleware; }
public static StreamRef Deserialize(string path) => Deserialize(StreamPath.Deserialize(path));
/// <summary> /// Acquires the stream reference for the given id and type of the stream. /// </summary> /// <param name="system">The reference to actor system</param> /// <param name="provider">The name of the stream provider</param> /// <param name="id">The id</param> /// <returns>A stream reference</returns> public static StreamRef StreamOf(this IActorSystem system, string provider, string id) { return system.StreamOf(StreamPath.From(provider, id)); }
/// <summary> /// Acquires the stream reference for the given id and type of the stream. /// </summary> /// <typeparam name="TStream">The type of the stream</typeparam> /// <param name="system">The reference to actor system</param> /// <param name="id">The id</param> /// <returns>A stream reference</returns> public static StreamRef StreamOf <TStream>(this IActorSystem system, string id) where TStream : IStreamProvider { return(system.StreamOf(StreamPath.From(typeof(TStream), id))); }
public bool Equals(StreamPath other) => Path.Equals(other);
public static StreamRef Deserialize(StreamPath path) { return(new StreamRef(path, path.Proxy())); }
protected internal StreamRef(StreamPath path, IStreamProvider provider = null) { Path = path; this.provider = provider; }
protected StreamRef(StreamPath path) { Path = path; }