if  parameter is a function, use that function as stream agent

see discussion in #80