Ejemplo n.º 1
0
 void ThrowIfMethodDoesNotRunAsynchronous(ICanProcessDataPoints processor, MethodInfo method)
 {
     if (method.ReturnType != typeof(Task))
     {
         throw new DataPointProcessorMethodMustBeAsync(processor.GetType(), method);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DataPointProcessor"/> class.
        /// </summary>
        /// <param name="processor">The actual <see cref="ICanProcessDataPoints">processor</see>.</param>
        /// <param name="method">The <see cref="MethodInfo">method</see> that processes.</param>
        public DataPointProcessor(ICanProcessDataPoints processor, MethodInfo method)
        {
            Id        = Guid.NewGuid();
            Processor = processor;
            Method    = method;

            ThrowIfMethodDoesNotRunAsynchronous(processor, method);
        }