# Are delegates blocking or asynchronous?

**URL:** <https://forums.unrealengine.com/t/are-delegates-blocking-or-asynchronous/415344>\
**Category:** Platform & Builds\
**Tags:** async, blocking, unreal-engine, delegates, question\
**Created:** [January 23, 2018, 3:06pm UTC](https://forums.unrealengine.com/t/are-delegates-blocking-or-asynchronous/415344 "2018-01-23T15:06:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GlassBeaver](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/glassbeaver/32/551492_2.png) [@GlassBeaver](https://forums.unrealengine.com/u/GlassBeaver)\
**Post date:** [January 23, 2018, 3:06pm UTC](https://forums.unrealengine.com/t/are-delegates-blocking-or-asynchronous/415344/1 "2018-01-23T15:06:31Z")

</div>

Very basic question, as the title suggests: when I subscribe to a delegate via AddDynamic() and then call Broadcast() on it, does it process the event in a blocking fashion, or is it asynchronous?

Example:

```
DelegatesComponent->SquadLeaderChanged.AddDynamic(this, &USquadMembershipComponent::OnSquadLeaderChanged);
DelegatesComponent->SquadLeaderChanged.Broadcast(Squad->SquadLeader);

// IS THIS GUARANTEED TO EXECUTE ONLY AFTER OnSquadLeaderChanged HAS FINISHED?
Something();

void USquadMembershipComponent::OnSquadLeaderChanged(AActor* SquadLeader)
{
	bSquadLeader = GetOwner() == SquadLeader;
}

```

So does Something() execute only after OnSquadLeaderChanged() has finished, or is another thread listening via Broadcast()?

I couldn’t really find anything in the source code.

---

<div class="post-metadata">

**Author:** ![birdfreeyahoo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@birdfreeyahoo](https://forums.unrealengine.com/u/birdfreeyahoo)\
**Post date:** [January 23, 2018, 4:07pm UTC](https://forums.unrealengine.com/t/are-delegates-blocking-or-asynchronous/415344/2 "2018-01-23T16:07:51Z")

</div>

The implementation of delegates is very complicated and is completed by UHT at compile-time.  
It looks like the event is sent to the registered UObject synchronously. I can’t tell you 100% if it is complete synchronous, but it looks like that.

I also use delegates and didn’t run into async problems, the always fire at the right time.

---

<div class="post-metadata">

**Author:** ![GlassBeaver](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/glassbeaver/32/551492_2.png) [@GlassBeaver](https://forums.unrealengine.com/u/GlassBeaver)\
**Post date:** [January 23, 2018, 4:21pm UTC](https://forums.unrealengine.com/t/are-delegates-blocking-or-asynchronous/415344/3 "2018-01-23T16:21:06Z")

</div>

Thanks and yeah, that’s also been my experience so far. Just wanted someone with more insight to confirm if it is guaranteed to be the case. I guess if I don’t get a dev to answer then I’ll just mark this as accepted in a couple of days.
