How to subscribe to an event with a <suspends> function

You can’t directly put a function with suspends effect on epic-made devices. You might want to use spawn{} inside a function with no suspends effect on it so you can call that function. Here is an example:

LockOn_start(Guard: agent): void=
     spawn{LockOn(Guard)}
7 Likes