Closed tjaskula closed 5 years ago
Would be nice to report code that doesn't compile.
Ok, this is source that was generated:
using System;
using System.Collections.Generic;
using Vlingo.Actors;
using Vlingo.Common;
using Vlingo.Wire.Channel;
using System.Net.Sockets;
namespace Vlingo.Wire.Channel
{
public class ResponseSenderChannel__Proxy : IResponseSenderChannel<Socket>
{
private const string AbandonRepresentation1 = "Abandon(RequestResponseContext<Socket>)";
private const string RespondWithRepresentation2 = "RespondWith(RequestResponseContext<Socket>, IConsumerByteBuffer)";
private readonly Actor actor;
private readonly IMailbox mailbox;
public ResponseSenderChannel__Proxy(Actor actor, IMailbox mailbox)
{
this.actor = actor;
this.mailbox = mailbox;
}
public void Abandon(RequestResponseContext<Socket> context)
{
if(!actor.IsStopped)
{
Action<IResponseSenderChannel<Socket>> consumer = x => x.Abandon(context);
if(mailbox.IsPreallocated)
{
mailbox.Send(actor, consumer, null, AbandonRepresentation1);
}
else
{
mailbox.Send(new LocalMessage<IResponseSenderChannel<Socket>>(actor, consumer, AbandonRepresentation1));
}
}
else
{
actor.DeadLetters.FailedDelivery(new DeadLetter(actor, AbandonRepresentation1));
}
}
public void RespondWith(RequestResponseContext<Socket> context, IConsumerByteBuffer buffer)
{
if(!actor.IsStopped)
{
Action<IResponseSenderChannel<Socket>> consumer = x => x.RespondWith(context, buffer);
if(mailbox.IsPreallocated)
{
mailbox.Send(actor, consumer, null, RespondWithRepresentation2);
}
else
{
mailbox.Send(new LocalMessage<IResponseSenderChannel<Socket>>(actor, consumer, RespondWithRepresentation2));
}
}
else
{
actor.DeadLetters.FailedDelivery(new DeadLetter(actor, RespondWithRepresentation2));
}
}
}
}
It doesn't compile because it lacks an using for IConsumerByteBuffer
. Adding the using produces valid code.
Another one on
using System;
using System.Collections.Generic;
using Vlingo.Actors;
using Vlingo.Common;
namespace Vlingo.Common
{
public class Scheduled__Proxy : IScheduled
{
private const string IntervalSignalRepresentation1 = "IntervalSignal(IScheduled, object)";
private readonly Actor actor;
private readonly IMailbox mailbox;
public Scheduled__Proxy(Actor actor, IMailbox mailbox)
{
this.actor = actor;
this.mailbox = mailbox;
}
public void IntervalSignal(IScheduled scheduled, object data)
{
if(!actor.IsStopped)
{
Action<IScheduled> consumer = x => x.IntervalSignal(scheduled, data);
if(mailbox.IsPreallocated)
{
mailbox.Send(actor, consumer, null, IntervalSignalRepresentation1);
}
else
{
mailbox.Send(new LocalMessage<IScheduled>(actor, consumer, IntervalSignalRepresentation1));
}
}
else
{
actor.DeadLetters.FailedDelivery(new DeadLetter(actor, IntervalSignalRepresentation1));
}
}
}
}
vlingo-net/actors: Generating proxy for main: IScheduled Dynamically generated class source for Vlingo.Common.Scheduled__Proxy did not compile because: The type or namespace name 'Actors' does not exist in the namespace 'Vlingo' (are you missing an assembly reference?) at Vlingo.Common.Compiler.DynaCompiler.Compile(Input input)
This one with IScheduled
doesn't seem it lacks any using. It's just that it cannot resolve a reference to Vlingo.Actors
somehow. I've added the reference to the UT project but this doesn't seem to fix the problem.
The one with ResponseSenderChannel__Proxy
I fixed by adding the generated file to the project Vlingo.Wire
but doesn't seem I can do the same with Scheduled__Proxy
Fixed by #38
I have this following error rising in
vlingo-net-wire
has to be investigated.