diff --git a/docs/modules/ROOT/pages/lua/api/Event.adoc b/docs/modules/ROOT/pages/lua/api/Event.adoc index 977c858a9..a4487adeb 100644 --- a/docs/modules/ROOT/pages/lua/api/Event.adoc +++ b/docs/modules/ROOT/pages/lua/api/Event.adoc @@ -3,6 +3,12 @@ +[cols="1,5a",separator="!"] +!=== +!Dependencies +! xref:/lua/api/ReflectionSystemStructModule.adoc[ReflectionSystemStructModule] +!=== + == Globals === **event** @@ -76,3 +82,26 @@ Returns directly if there is already a signal in the queue (the tick doesn¬タ !=== ==== +=== __event.__**registerListener** (xref:/reflection/structs/EventFilter.adoc[EventFilter], function(event, sender, ...)) -> integer +Registers the given function as a listener. +When `event.pull()` pulls a signal from the queue, that matches the given Event-Filter, +a Task will be created using the function and the signals parameters will be passed into the function. + +=== __event.__**waitFor** (xref:/reflection/structs/EventFilter.adoc[EventFilter]) -> xref:/reflection/structs/Future.adoc[Future] +Returns a Future that resolves when a signal got polled that matches the given Event Filter. + +=== __event.__**queue** (xref:/reflection/structs/EventFilter.adoc[EventFilter]) -> xref:/lua/api/Event.adoc#_eventqueue[EventQueue] +Creates a new event queue. +When this variable closes or gets garbage collected, it will stop receiving signals. + +== Types + +=== **EventQueue** + + +=== __EventQueue.__**pull** () + + +=== __EventQueue.__**waitFor** () +Returns a Future that resolves when a signal got added to the queue that matches the given Event Filter. +