The disclosure relates to technology handling events in a distributed computing environment. Events comprising a function executable by an instance are received from an event queue. The received events are mapped to an instance in a pool that executes a corresponding function. When it is determined that the instances in the pool are at least one of unavailable and do not include the function corresponding to the event, a new instance is created in the pool, where the new instance includes the function corresponding to the event. Instances in the pool may be terminated when frequency of occurrence patterns of the event with a corresponding function indicate the event is occurring less frequently such that fewer instances are required to execute the corresponding function. Otherwise, the events are dispatched to the appropriate instance in the pool for execution.