(self, func, model)
return res
This function is called by an `AsyncEvent` to make callbacks processed in Event._trigger cancellable.
        Using asyncio this will result in a try-catch block catching CancelledEvents.
        Args:
            func (callable): The partial of Event._trigger with all parameters already assigned
            model (object): The currently processed model

        Returns:
            bool: returns the success state of the triggered event
This function is called by an `AsyncEvent` to make callbacks processed in Event._trigger cancellable.
        Using asyncio this will result in a try-catch block catching CancelledEvents.
        Args:
            func (callable): The partial of Event._trigger with all parameters already assigned
            model (object): The currently processed model
This function is called by an AsyncEvent to make callbacks processed in Event . _trigger cancellable . Using asyncio this will result in a try - catch block catching CancelledEvents . Args : func ( callable ) : The partial of Event . _trigger with all parameters already assigned model ( object ) : The currently processed model
async def process_context(self, func, model):
        """
        This function is called by an `AsyncEvent` to make callbacks processed in Event._trigger cancellable.
        Using asyncio this will result in a try-catch block catching CancelledEvents.
        Args:
            func (callable): The partial of Event._trigger with all parameters already assigned
            model (object): The currently processed model

        Returns:
            bool: returns the success state of the triggered event
        """
        if self.current_context.get() is None:
            self.current_context.set(asyncio.current_task())
            if id(model) in self.async_tasks:
                self.async_tasks[id(model)].append(asyncio.current_task())
            else:
                self.async_tasks[id(model)] = [asyncio.current_task()]
            try:
                res = await self._process(func, model)
            except asyncio.CancelledError:
                res = False
            finally:
                self.async_tasks[id(model)].remove(asyncio.current_task())
                if len(self.async_tasks[id(model)]) == 0:
                    del self.async_tasks[id(model)]
        else:
            res = await self._process(func, model)
        return res
async def process_context ( self , func , model ) : if self . current_context . get ( ) is None : self . current_context . set ( asyncio . current_task ( ) ) if id ( model ) in self . async_tasks : self . async_tasks [ id ( model ) ] . append ( asyncio . current_task ( ) ) else : self . async_tasks [ id ( model ) ] = [ asyncio . current_task ( ) ] try : res = await self . _process ( func , model ) except asyncio . CancelledError : res = False finally : self . async_tasks [ id ( model ) ] . remove ( asyncio . current_task ( ) ) if len ( self . async_tasks [ id ( model ) ] ) == 0 : del self . async_tasks [ id ( model ) ] else : res = await self . _process ( func , model ) return res