Level / community

Discussion, support and common information for projects in the community.
MIT License
43 stars 15 forks source link

How can I read a stream of operations? #64

Closed christianbundy closed 5 years ago

christianbundy commented 5 years ago

Apologies if this is in the wrong repo.

I'd like to be able to subscribe to a stream of operations on a levelup instance -- is that something that I can do, or is that something that would have to be supported by a given store? For example, I'd like to receive a list of all of the put or del operations, especially if I'm able to see the list of past operations.

Thanks!

vweevers commented 5 years ago

For example, I'd like to receive a list of all of the put or del operations

That's possible. There are modules for "live streams" (using events emitted by levelup). Have a look at the Streams section of Level/awesome, as well as Hooks for lower-level utils, and perhaps Benchmarking & Debugging.

especially if I'm able to see the list of past operations.

You can get past data, I don't know about past operations. You would have to store that yourself.

vweevers commented 5 years ago

Feel free to reopen if you have further questions.