bug in asynch_observer

1 view
Skip to first unread message

esha...@gmail.com

unread,
May 8, 2008, 1:16:07 PM5/8/08
to beanstalk-talk
With a default tube I get an error unless I put in the unless
tube.blank? as below in lib/async_observer/queue.rb:
def put!(obj, pri=DEFAULT_PRI, delay=DEFAULT_DELAY, ttr=DEFAULT_TTR,
tube=DEFAULT_TUBE)
return sync_run(obj) if !queue
queue.connect()
queue.use(tube) unless tube.blank?
return queue.yput(obj, pri, delay, ttr), queue.last_server
end


This seems to be because of lib/async_observer/queue.rb:
tube = opts.fetch(:tube, app_version)

I don't supply an app version parameter so maybe that's why. Anyway,
modding the following line in lib/async_observer/queue.rb works:
queue.use(tube) unless tube.blank?

Thanks,
Eric

Dustin

unread,
May 8, 2008, 2:51:41 PM5/8/08
to beanstalk-talk

Interesting, I've apparently been falling behind in async observer
-- there are a lot of changes I don't have.

I don't think it makes sense for async observer to specify the tube
based on the app version. I've modified beanstalk client for my needs
so that you can specify a default tube for reading and writing in your
config. You can specify the app version as the default tube if you'd
like, or you can specify some other identifier that includes the app
version.

In my case, I've got a few small apps I want to run through a single
beanstalk instance without their jobs conflicting.

Keith Rarick

unread,
May 8, 2008, 2:59:11 PM5/8/08
to beansta...@googlegroups.com
On Thu, May 8, 2008 at 10:16 AM, esha...@gmail.com <esha...@gmail.com> wrote:
> With a default tube I get an error unless I put in the unless
> tube.blank? as below in lib/async_observer/queue.rb:
> ...

> This seems to be because of lib/async_observer/queue.rb:
> tube = opts.fetch(:tube, app_version)
>
> I don't supply an app version parameter so maybe that's why. Anyway,
> modding the following line in lib/async_observer/queue.rb works:
> queue.use(tube) unless tube.blank?

I fixed this in a slightly different way; I changed

tube = opts.fetch(:tube, app_version)

to

tube = opts.fetch(:tube, (app_version or DEFAULT_TUBE))

Let me know if it works for you!

kr

Keith Rarick

unread,
May 8, 2008, 3:06:16 PM5/8/08
to beansta...@googlegroups.com
On Thu, May 8, 2008 at 11:51 AM, Dustin <dsal...@gmail.com> wrote:
> Interesting, I've apparently been falling behind in async observer
> -- there are a lot of changes I don't have.

I'm thinking of moving async_observer to a git repo on github. Would
that make it easier to follow?

Does anyone have any objections to moving async_observer to git?

Rails has support for installing plugins from git as of d07d6e9 (aka
svn 9049), but it's not included in any rails release yet AFAIK.

> I don't think it makes sense for async observer to specify the tube
> based on the app version. I've modified beanstalk client for my needs
> so that you can specify a default tube for reading and writing in your
> config. You can specify the app version as the default tube if you'd
> like, or you can specify some other identifier that includes the app
> version.

I'd like to just rename app_version to default_tube or something. As
of ad4f36e it's not used for anything else. Would that work?

> In my case, I've got a few small apps I want to run through a single
> beanstalk instance without their jobs conflicting.

Makes sense.

kr

Dustin

unread,
May 8, 2008, 3:35:56 PM5/8/08
to beanstalk-talk

On May 8, 12:06 pm, "Keith Rarick" <k...@causes.com> wrote:
> I'm thinking of moving async_observer to a git repo on github. Would
> that make it easier to follow?

It's certainly my preference. :)

> I'd like to just rename app_version to default_tube or something. As
> of ad4f36e it's not used for anything else. Would that work?

Sounds good. They're *slightly* different, but I've never changed
app version, so I'd say it's right.

esha...@gmail.com

unread,
May 8, 2008, 3:53:37 PM5/8/08
to beanstalk-talk
Perfect. Yes I verified that does work. Thanks!

--> Eric

On May 8, 11:59 am, "Keith Rarick" <k...@causes.com> wrote:
Reply all
Reply to author
Forward
0 new messages