diff options
author | xenoxeno <xeno@ydb.tech> | 2023-03-09 12:10:01 +0300 |
---|---|---|
committer | xenoxeno <xeno@ydb.tech> | 2023-03-09 12:10:01 +0300 |
commit | ad607bb887619f321dec03b02df8220e01b7f5aa (patch) | |
tree | 7d5c87352cbe835b56bb2bdac93b37cbdf8ead21 /library/cpp/actors/core/actor.cpp | |
parent | 6324d075a5e80b6943b5de6b465b775050fe83df (diff) | |
download | ydb-ad607bb887619f321dec03b02df8220e01b7f5aa.tar.gz |
light events for actor system
Diffstat (limited to 'library/cpp/actors/core/actor.cpp')
-rw-r--r-- | library/cpp/actors/core/actor.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/library/cpp/actors/core/actor.cpp b/library/cpp/actors/core/actor.cpp index 00eef387ea..304f7405ae 100644 --- a/library/cpp/actors/core/actor.cpp +++ b/library/cpp/actors/core/actor.cpp @@ -16,6 +16,22 @@ namespace NActors { return SelfActorId.Send(recipient, ev, flags, cookie, std::move(traceId)); } + bool IActor::Send(const TActorId& recipient, IEventHandleLight* ev) const noexcept { + return SelfActorId.Send(recipient, ev); + } + + bool IActor::Send(const TActorId& recipient, IEventHandleLight* ev, ui32 flags) const noexcept { + return SelfActorId.Send(recipient, ev, flags); + } + + bool IActor::Send(const TActorId& recipient, IEventHandleLight* ev, ui32 flags, ui64 cookie) const noexcept { + return SelfActorId.Send(recipient, ev, flags, cookie); + } + + bool IActor::Send(const TActorId& recipient, IEventHandleLight* ev, ui32 flags, ui64 cookie, NWilson::TTraceId traceId) const noexcept { + return SelfActorId.Send(recipient, ev, flags, cookie, std::move(traceId)); + } + void TActivationContext::Schedule(TInstant deadline, TAutoPtr<IEventHandle> ev, ISchedulerCookie* cookie) { TlsActivationContext->ExecutorThread.Schedule(deadline, ev, cookie); } @@ -29,15 +45,15 @@ namespace NActors { } void TActorIdentity::Schedule(TInstant deadline, IEventBase* ev, ISchedulerCookie* cookie) const { - return TActivationContext::Schedule(deadline, new IEventHandle(*this, {}, ev), cookie); + return TActivationContext::Schedule(deadline, new IEventHandleFat(*this, {}, ev), cookie); } void TActorIdentity::Schedule(TMonotonic deadline, IEventBase* ev, ISchedulerCookie* cookie) const { - return TActivationContext::Schedule(deadline, new IEventHandle(*this, {}, ev), cookie); + return TActivationContext::Schedule(deadline, new IEventHandleFat(*this, {}, ev), cookie); } void TActorIdentity::Schedule(TDuration delta, IEventBase* ev, ISchedulerCookie* cookie) const { - return TActivationContext::Schedule(delta, new IEventHandle(*this, {}, ev), cookie); + return TActivationContext::Schedule(delta, new IEventHandleFat(*this, {}, ev), cookie); } TActorId TActivationContext::RegisterWithSameMailbox(IActor* actor, TActorId parentId) { @@ -75,27 +91,27 @@ namespace NActors { } void TActorContext::Schedule(TInstant deadline, IEventBase* ev, ISchedulerCookie* cookie) const { - ExecutorThread.Schedule(deadline, new IEventHandle(SelfID, TActorId(), ev), cookie); + ExecutorThread.Schedule(deadline, new IEventHandleFat(SelfID, TActorId(), ev), cookie); } void TActorContext::Schedule(TMonotonic deadline, IEventBase* ev, ISchedulerCookie* cookie) const { - ExecutorThread.Schedule(deadline, new IEventHandle(SelfID, TActorId(), ev), cookie); + ExecutorThread.Schedule(deadline, new IEventHandleFat(SelfID, TActorId(), ev), cookie); } void TActorContext::Schedule(TDuration delta, IEventBase* ev, ISchedulerCookie* cookie) const { - ExecutorThread.Schedule(delta, new IEventHandle(SelfID, TActorId(), ev), cookie); + ExecutorThread.Schedule(delta, new IEventHandleFat(SelfID, TActorId(), ev), cookie); } void IActor::Schedule(TInstant deadline, IEventBase* ev, ISchedulerCookie* cookie) const noexcept { - TlsActivationContext->ExecutorThread.Schedule(deadline, new IEventHandle(SelfActorId, TActorId(), ev), cookie); + TlsActivationContext->ExecutorThread.Schedule(deadline, new IEventHandleFat(SelfActorId, TActorId(), ev), cookie); } void IActor::Schedule(TMonotonic deadline, IEventBase* ev, ISchedulerCookie* cookie) const noexcept { - TlsActivationContext->ExecutorThread.Schedule(deadline, new IEventHandle(SelfActorId, TActorId(), ev), cookie); + TlsActivationContext->ExecutorThread.Schedule(deadline, new IEventHandleFat(SelfActorId, TActorId(), ev), cookie); } void IActor::Schedule(TDuration delta, IEventBase* ev, ISchedulerCookie* cookie) const noexcept { - TlsActivationContext->ExecutorThread.Schedule(delta, new IEventHandle(SelfActorId, TActorId(), ev), cookie); + TlsActivationContext->ExecutorThread.Schedule(delta, new IEventHandleFat(SelfActorId, TActorId(), ev), cookie); } TInstant TActivationContext::Now() { @@ -145,7 +161,7 @@ namespace NActors { (actor->*StateFunc)(ev, TActivationContext::AsActorContext()); } - void TActorVirtualBehaviour::Receive(IActor* actor, std::unique_ptr<IEventHandle> ev) { + void TActorVirtualBehaviour::Receive(IActor* actor, std::unique_ptr<IEventHandleFat> ev) { Y_VERIFY(!!ev && ev->GetBase()); ev->GetBase()->Execute(actor, std::move(ev)); } |