SetInterval: Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment

How i can do this?

setInterval ->
	user = Meteor.users.findOne().fetch()
	console.log user
, 1000

i get error Error: Meteor code must always run within a Fiber. Try wrapping callbacks that you pass to non-Meteor libraries with Meteor.bindEnvironment.

P.S. i not want use Meteor.setInterval. I want to learn how to wrap any function in a fiber context.

if i do this:

setInterval Meteor.bindEnvironment ->
	user = Meteor.users.findOne()
	console.log user
, 1000

i get this error onException argument must be a function, string or undefined for Meteor.bindEnvironment().

oh… i figet brackets =)

setInterval Meteor.bindEnvironment( ->
	user = Meteor.users.findOne()
	console.log user
), 1000

Meteor.setInterval handles this scenario.

2 Likes

You are really, really, really offensive. And after seeing some of your other posts, I think you have a problem.

4 Likes

@copleykj is a well liked and respected member of the community, he deserves to be treated kindly. just like everyone does. @illustreets is right

1 Like

I am human and far from perfect, so I apologize for missing the fact that you didn’t want to use the functionality that Meteor already provides for this use case. Also I’m very sorry for whatever trauma you’ve experienced in your life that has damaged you and ruined your ability to interact with other human beings. That said, your childish entitlement, and lack of basic human decency and social etiquette almost certainly guarantees that you’ll not find many members of this community willing to help you. I’d say that maybe you should be banned for such behavior, but I think karma has a way of dealing with such horrible people, and so I wish you the best as you seek answers to any future problems you might have.

3 Likes