<alderamin>
I'm using concurrent-ruby to split a sequence of jobs over java threads. I have a block I'm passing to each Promise/Future, but instead of evaluating the block and passing it to the appropriate Promise/Future, it looks like it's passing a reference to the block.
<alderamin>
So each Promise is evaluating the same block, which is definitely not what I want. How do I generate a new instance of a block for each Promise?
<alderamin>
Just Proc.new?
xkickflip has quit [Quit: xkickflip]
havenwood has joined #jruby
lopex has quit [Quit: Connection closed for inactivity]
dinfuehr has joined #jruby
dinfuehr has quit [Ping timeout: 260 seconds]
<headius>
alderamin: I believe there's a Gitter channel for concurrent-ruby that might be a better place to ask
<headius>
I'm not sure how they have implemented promises
nirvdrum has quit [Remote host closed the connection]
<headius>
it's usually pretty active
<alderamin>
Thanks, I just figured it out.
<alderamin>
I wasn't passing arguments to the Proc each time I wanted it called in a new Promise/Future, which means it was using its persistent local variables, which got rewritten each time I called it.
<alderamin>
So it was executing N promises, each referencing the Nth Promise's last set values...
xkickflip has joined #jruby
<headius>
alderamin: ahh ok
<alderamin>
Gotta love that functional programming.
<headius>
hah yeah indeed :-)
<headius>
how's concurrent-ruby treating you otherwise? It's quite the toolkit
AnoHito_ has quit [Quit: Leaving]
yfeldblum has quit [Remote host closed the connection]
<alderamin>
Honestly I can't compare it to anything else. My course in concurrent programming didn't do a lot of truly parallel processing stuff.
<alderamin>
Either high-level stuff like hadoop and message-passing or low-level principles.
<alderamin>
I've used Ruby threads over JRuby, but that's all really high-level stuff, too.
yfeldblum has joined #jruby
<headius>
ok sure...well you're in the right place at least
<headius>
there's been a lot of work on concurrent-ruby...it's the only library I recommend now
<alderamin>
I've dipped my toe into scala. That got weird.
<headius>
I think that pretty much defines Scala
<headius>
"It got weird"
<headius>
I only played with it for a couple days, and by the end it was indistinguishable from line noise
<alderamin>
Well, Akka.
<alderamin>
The actor system is really impressive.
<alderamin>
But it's so paradigm-shifting it's hard to think about how to construct even small applications using it.
<alderamin>
I'm excited to see concurrent-ruby expanding to actors. I deal with a lot of highly parallelizable data. The idea of dumping it into an actor is pretty attractive.
<alderamin>
But Futures and thread pools take care of my thread management right now. I'm pretty happy with the setup I got working tonight. For now, at least.
<alderamin>
I have to go home. I have a feeling I'll be back.
alderamin has quit []
bjfish2 has joined #jruby
bjfish2 has quit [Ping timeout: 256 seconds]
dinfuehr has joined #jruby
yfeldblum has quit [Remote host closed the connection]
dinfuehr has quit [Ping timeout: 256 seconds]
mike___1234 has quit [Ping timeout: 240 seconds]
mike___1234 has joined #jruby
tvo has joined #jruby
tvo has joined #jruby
dinfuehr has joined #jruby
pgokeeffe has quit [Read error: Connection reset by peer]
pgokeeffe has joined #jruby
colinsurprenant has joined #jruby
pitr-ch has joined #jruby
yfeldblum has joined #jruby
tvo has quit [Quit: Leaving.]
yfeldblum has quit [Ping timeout: 244 seconds]
samphippen has joined #jruby
donV has joined #jruby
yfeldblum has joined #jruby
colinsurprenant has quit [Quit: colinsurprenant]
dinfuehr has quit [Remote host closed the connection]
rsim has joined #jruby
mdedetrich has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dinfuehr has joined #jruby
dinfuehr has quit [Ping timeout: 244 seconds]
havenwood has quit [Ping timeout: 240 seconds]
samphippen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pitr-ch has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blaxter has joined #jruby
benlovell has joined #jruby
yfeldblum has quit [Ping timeout: 264 seconds]
blaxter has quit [Ping timeout: 252 seconds]
yfeldblum has joined #jruby
blaxter has joined #jruby
dinfuehr has joined #jruby
shellac has joined #jruby
samphippen has joined #jruby
DomKM has joined #jruby
dinfuehr has quit [Ping timeout: 264 seconds]
AnoHito has joined #jruby
drbobbeaty has joined #jruby
vtunka has joined #jruby
xkickflip_ has joined #jruby
xkickflip has quit [Ping timeout: 252 seconds]
xkickflip_ is now known as xkickflip
shellac has quit [Ping timeout: 272 seconds]
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lopex has joined #jruby
dinfuehr has joined #jruby
dinfuehr has quit [Ping timeout: 272 seconds]
benlovell has quit [Ping timeout: 246 seconds]
benlovell has joined #jruby
benlovell has quit [Ping timeout: 246 seconds]
benlovell has joined #jruby
shellac has joined #jruby
samphippen has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dinfuehr has joined #jruby
dinfuehr has quit [Ping timeout: 240 seconds]
pitr-ch has joined #jruby
drbobbeaty has joined #jruby
pitr-ch has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samphippen has joined #jruby
benlovell has quit [Ping timeout: 264 seconds]
mdedetrich has joined #jruby
shellac has quit [Quit: Computer has gone to sleep.]
cristianrasch has joined #jruby
dinfuehr has joined #jruby
vtunka has quit [Quit: Leaving]
dinfuehr has quit [Ping timeout: 265 seconds]
cristianrasch has quit [Quit: Leaving]
yfeldblum has quit [Ping timeout: 244 seconds]
samphipp_ has joined #jruby
samphippen has quit [Remote host closed the connection]
benlovell has joined #jruby
cristianrasch has joined #jruby
temporalfox has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Antiarc>
That's an example of the startup error I was referring to
digitalextremist has quit [Ping timeout: 256 seconds]
<Antiarc>
It's not always the case that it's a method of a Java object, but in this case I think it should be pretty clear that it's an erroneous condition
<Antiarc>
Since that class was successfully loaded, and instances of it do have the original_text method
temporalfox has joined #jruby
xkickflip has quit [Ping timeout: 246 seconds]
xkickflip has joined #jruby
<Antiarc>
The code there is document.get(TokensAnnotation).map {|e| [e.original_text, e.ner] }, where document is an Annotation from the Stanford NLP package
dinfuehr has joined #jruby
<Antiarc>
edu.stanford.nlp.pipeline.Annotation
dinfuehr has quit [Ping timeout: 264 seconds]
JRubyGithub has joined #jruby
<JRubyGithub>
[jruby] dg-ratiodata opened issue #3162: Different results for `to_h` and `to_hash` on `ENV` http://git.io/vYkHm
* mberg
may actually have a bunch of BNC connectors still in a toolbox in the attic. And at least one 10base5 MAU.
<nirvdrum>
enebo: Are we going to Leeroy Jenkins this?
<mberg>
If you're going to get tattooed for a jruby conference, I would suggest "java" and "ruby" across your knuckles.
vtunka has quit [Quit: Leaving]
<enebo>
mberg: Last year I finally got rid of my Sun 3/60 which had a BNC connector ethernet card (with a weird converter attached to bridge to a modern network
<enebo>
I did not get rid of it for a long time because it had a 17”x17” video card which could drive a 17” monitor…not bad for 1980s tech
<enebo>
color monitor to boot
<enebo>
dimensions of board seems to correlate to size of monitor :)
<mberg>
Nice. I shed the last of my Sun hardware during my last move. I had an IPC with a 15-pin AUI with a 10BT transciever hung off it.
<enebo>
mberg: I have some old ultrasparcs in a closet I never used (someone dumped them off on me — battery for prom died on all of them)
<rtyler>
are we having an old guy contest now?
<rtyler>
what happened :P
<mberg>
I also had a couple Sun Entprise servers, but a cat peed on them. :/
<rtyler>
doing you a favor
<rtyler>
ain't nobody got power for those things anymore
<mberg>
One of them had a dead nvram batter, so I had to set a mac address every time I power-cycled it.
pitr-ch has joined #jruby
pitr-ch has quit [Client Quit]
havenwood has joined #jruby
pitr-ch has joined #jruby
<rtyler>
[BNC]kares: I'm not sure I love jruby or gradle enough to tatto them anywhere :P
<enebo>
heh
<enebo>
to both cat and tattoos
colinsurprenant has joined #jruby
<mberg>
The smell of server shorting on cat urine is not something I ever want to smell again.
dinfuehr has joined #jruby
colinsurprenant has quit [Client Quit]
dinfuehr has quit [Ping timeout: 256 seconds]
cristianrasch has quit [Ping timeout: 246 seconds]
jmimi has joined #jruby
tenderlove has quit [Quit: Leaving...]
tcrawley is now known as tcrawley-away
nateberkopec has joined #jruby
tenderlove has joined #jruby
drbobbeaty has quit [Read error: Connection reset by peer]
<[BNC]kares>
... as all releases now will be over 9000!
enebo has quit [Quit: enebo]
mike___1234 has quit [Ping timeout: 244 seconds]
mike___1234 has joined #jruby
mike___1234 has quit [Max SendQ exceeded]
drbobbeaty has quit [Read error: Connection reset by peer]
dinfuehr has joined #jruby
drbobbeaty has joined #jruby
dinfuehr has quit [Ping timeout: 240 seconds]
etehtsea has quit [Quit: Computer has gone to sleep.]
yfeldblum has joined #jruby
chamila has joined #jruby
pipework has quit [Ping timeout: 264 seconds]
camlow32_ has quit [Remote host closed the connection]
pipework has joined #jruby
blaines has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
camlow325 has joined #jruby
<slash_nick>
Congratulations #jruby !
elbens has joined #jruby
colinsurprenant has joined #jruby
<elbens>
Does anyone have any writeups on how to deal with gem management when targeting MRI and JRuby? We are exploring running parts of our software on JRuby (non-web processes that would really benefit from real threads). So far, I’ve just been removing incompatible gems from Gemfile.lock. Is the best way forward to keep two Gemfile.lock files in source control?
<nirvdrum>
elbens: Use the :platform or :platforms option in your Gemfile.
<elbens>
I did, but the generated Gemfile.lock seems to not differentiate between the two platforms
<nirvdrum>
Are you seeing an actual problem? The Gemfile.lock will just list everything, I think. The Gemfile will dictate what to load.
<elbens>
`bundle install` will fail, no?
<elbens>
if I *didn’t* have a Gemfile.lock, and ran “bundle install” on both plaforms, i would get differentiating Gemfile.lock file. I think that is the core of the issue
benlovell has joined #jruby
etehtsea has joined #jruby
mjelen has quit [Remote host closed the connection]
colinsurprenant has quit [Quit: colinsurprenant]
benlovell has quit [Ping timeout: 256 seconds]
blaines has joined #jruby
blaines has quit [Client Quit]
dcorbin has joined #jruby
<dcorbin>
Congrats to the jruby team on their new release.
colinsurprenant has joined #jruby
etehtsea has quit [Quit: Computer has gone to sleep.]
<olleolleolle>
Is there a "mvnw" guide anywhere?
<olleolleolle>
(And, congratulations. So. Many. Years. Of. Effort.)
etehtsea has joined #jruby
goyox86_ has joined #jruby
<mkristian>
olleolleolle, I guess replacing mvn with ./mvnw in BUILDING.md should do
<bjfish2>
lukas i think c extensions might be coming for truffle cc: chrisseaton
<lukas>
i was planning on porting the distance-measures library to pure ruby, and i want to stay away from unicorn in favor of puma on my production system
<lukas>
bjfish2: that looks interesting
tcrawley is now known as tcrawley-away
<chrisseaton>
Yeah we have research on supporting C extensions but it's early days
<Antiarc>
lukas: I'd personally find a Java lib that provides those and write a little wrapper around it, personally
<lukas>
i'm probably going to try and take over some of the abandoned k-means and k-clustering computation gems anyways, and i'd rather have them work better with jruby than using C extensions
<Antiarc>
You can probably leverage existing java libraries for that
<lukas>
yeah, true
<Antiarc>
That way the hard work is done in Java anyhow
<Antiarc>
Where it'll be faster
<Antiarc>
We've had marvelous success with using stanford NLP stuff from JRuby
<lukas>
but wait, can i use clojure and jruby on the same JVM?
<Antiarc>
Super drop-dead easy and far better NLP than exists anywhere in MRI
<sluukkonen>
lukas: yes
<lukas>
oh boy, i love my job haha
<lukas>
now i'll get to stay up late porting out MRI ruby ecosystem to jruby
<sluukkonen>
we have a rails app where the analytics part is implemented in clojure
<sluukkonen>
works like a charm
<lukas>
ah, nice
<lukas>
that seems like exactly something i would like to do, since i'm a big any sort of lisp fan
* lukas
has his emacs do most of the devops for him
bb010g has quit [Quit: Connection closed for inactivity]
<Antiarc>
The code there is document.get(TokensAnnotation).map {|e| [e.original_text, e.ner] }, where document is an Annotation from the Stanford NLP package
<Antiarc>
edu.stanford.nlp.pipeline.Annotation
<headius>
load issue?
<Antiarc>
The class is loaded and the object is instantiated
<Antiarc>
You can see there's an instance ID there
<lukas>
headius: yeah, that's what i would like to do
<Antiarc>
But it throws an NME which shouldn't be possible especially since this is a Java class
<headius>
oh, this is a Java class that doesn' thave everything bound yet?
<Antiarc>
Is that what's going on?
<Antiarc>
It's not always Java classes where this happens
<headius>
well in general you can't prevent this in Ruby if all the code uses is the existence of a class (since it may still be defining)
<headius>
but for Java classes we should only present the proxy class after it is fully bound
<Antiarc>
There's where it blows up. The path to that source is from the subscribe_to block, which just binds a RabbitMQ consumer
rsim has quit [Quit: Leaving.]
<Antiarc>
So it asks for jobs, when it gets one it's yielded to subscribe_to, which then instantiates the Java proxies around the document and does stuff on it
<Antiarc>
This only happens once during boot-up, and it works fine on subsequent invocations
<Antiarc>
The class is fully defined before any of this happens, since the RMQ setup instantiates this class as a worker for the consumer
<Antiarc>
the CoreLabel class is never directly referenced or instantiated in Ruby code - could that be the issue?
camlow325 has joined #jruby
<Antiarc>
The Annotation creates a bunch of various lists of labels such as TokenAnnotation, which is List<CoreLabel>, we do explicitly create an Annotation, but it then creates the TokensAnnotation and the CoreLabels - could it be that the proxy just isn't being bound fast enough?
dinfuehr has joined #jruby
camlow325 has quit [Remote host closed the connection]
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
samphippen has joined #jruby
camlow325 has joined #jruby
dinfuehr has quit [Ping timeout: 246 seconds]
havenwood has quit [Read error: Connection reset by peer]
rsim has joined #jruby
benlovell has joined #jruby
jmimi has quit [Ping timeout: 244 seconds]
benlovell has quit [Ping timeout: 244 seconds]
jmimi has joined #jruby
lanceball is now known as lance|afk
tcrawley is now known as tcrawley-away
havenwood has joined #jruby
camlow325 has quit [Remote host closed the connection]
havenwood has quit [Read error: Connection reset by peer]
<headius>
We're going to need to work with y'all to get some slides together on this stuff for JavaOne
<headius>
tooling is a big part of our talk
<headius>
Antiarc: looking
<headius>
Antiarc: that's my bet, yeah
<headius>
I suspect we're not hiding the in-progress proxy long enough and it is being made available before it's completely populated. That should be fixable with some atomic magic or a simple lock.
<headius>
if you can turn this into a repro we should be able to fix pretty quick
<rtyler>
headius: actually, I didn't mean to send that