framework icon indicating copy to clipboard operation
framework copied to clipboard

Event::flusher

Open pprins opened this issue 12 years ago • 5 comments

Hi,

Somehow I can't create an Event Flusher. It results in a: Call to undefined method Illuminate\Events\Dispatcher::flusher()

I can't find the flusher method anywhere in the API docs. Is it renamed, removed? See the Laravel documentation: http://laravel.com/docs/events#queued-events

pprins avatar Jun 16 '14 11:06 pprins

It seems to not exist, checked history and can't find any trace of a flusher() method existing within the Events package. I think it may have been a feature originally intended but I don't see the purpose of using it either. queue() and flush() are straightforward, using flusher() to add a callback to an event which would already have it's own call back would be somewhat unnecessary...

riotCode avatar Jun 16 '14 18:06 riotCode

I couldn't find a trace as well, thanks for helping. What I tried to achieve is a sort of queue event stack that all should run on App::after() for one request.

I now use a one time session for this but I think this could be implemented in a better way. Anyone?

pprins avatar Jun 16 '14 19:06 pprins

Interesting, I think something could be implemented for a similar effect to allow Events::flush() with no parameter to process all queued events or Events::flush('group.*') use a wildcard set of events.

App::after(function() {
    Event::flush();
    // or
    Event::flush('activity.*');
});

for example...

riotCode avatar Jun 16 '14 20:06 riotCode

Yeah that's old. You can just use Event::listen. There is no special method for "flushers".

taylorotwell avatar Jun 17 '14 02:06 taylorotwell

Removed from documentation.

taylorotwell avatar Jun 17 '14 02:06 taylorotwell