Discussion:
[Savonet-users] Order of hooks declarations
Yamakaky
2017-04-08 18:18:19 UTC
Permalink
Hi,

Does the return value of `on_*` have to be used or can it be ignored?
For example, is the following correct or do I have to use the return
value of `on_*` in `out()`?

```
musics = request.queue()

out(mksafe(musics))

ignore(on_end(musics, ...)
ignore(on_track(musics, ...)
```
Romain Beauxis
2017-04-10 15:07:24 UTC
Permalink
Hi,

Yes, you need to use them. on_* operators return a new source that needs to
be inserted into your streaming chain so that data is pulled from them and
they can operate. You can think about it like an intermediate adaptor
between two cables where you still need to plug the final one of have power
flows through.

So, something like:

source = (...)
source = on_track(fn, source)
source = on_end(fn, source)

(.. do something with source ..)

Romain
Post by Yamakaky
Hi,
Does the return value of `on_*` have to be used or can it be ignored?
For example, is the following correct or do I have to use the return
value of `on_*` in `out()`?
```
musics = request.queue()
out(mksafe(musics))
ignore(on_end(musics, ...)
ignore(on_track(musics, ...)
```
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Savonet-users mailing list
https://lists.sourceforge.net/lists/listinfo/savonet-users
Loading...