[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

DRb troubles, cannot Marshal or proxy objects successfully.

Sean Wolfe

1/8/2006 7:50:00 PM

I've been trying for hours trying ot get my DRb session store working.
I can get it to work in a gerneralized way, but I need to add some
validation to check the state of the session data, and keep track of
it, in case I need to invalidate the session data, so a user doen't
track with stale data on a website.

My first tries, I noticed that the objects that were coming in to my
Drb server were not being unmarshalled, This was fine if i just wanted
to store the data, but I needed to see values inside. So I tried
getting marshaling working. First i tried making class stubs for the
classes that were coming over, but I would get :
usr/lib/ruby/1.8/drb/drb.rb:582:in `load':dump format error (user class)

So then I tried proxying the code, but the first time it comes across, I get:
/usr/lib/ruby/1.8/drb/drb.rb:1094: `0x114475a is recycled object' (RangeError)

I've been searching all over the net and have only found some very
vague information.

I hope someone can help me out here...

Here's my code.
======drb_server.rb============
#!/usr/bin/env ruby -w

# This is a session storage daemon, basically just a hash,
# which is enabled for DRb access. But it has timestamping,
# for expiration and a way for setting if the information is invalid.

require 'drb/drb'

session_hash = Hash.new
session_hash.instance_eval { @mutex = Mutex.new; @user_hash = Hash.new }
TIMEOUT = 15 * 60 # 15 minute Timeout

#uncomment these classes if you want to marshal
#class User
#end
#
#class ActionController
#end
#
#class ActionController::Flash
#end
#
#class ActionController::Flash::FlashHash
#end

class <<session_hash

def []=(key, value)
begin
if value['user']
user_id = value['user'][:id]
if @user_hash[user_id]
@user_hash[user_id] = (@user_hash[user_id]) << key
else
@user_hash[user_id] = [ key ]
end
end
rescue
#contains an unknown object type
end
@mutex.synchronize do
super(key, [Time.now, value])
value
end
end

def [](key)
instance = nil
@mutex.synchronize do
instance = super(key)
end
if instance
# check the time
last_access = instance[0]
value = instance[1]
if(Time.now <= last_access + TIMEOUT)
#its within the timeout, update the new expiration
self[key] = value
return value
else
#it out of time, drop the session
delete(key)
return nil
end
else
return nil
end
end

def delete(key)
@mutex.synchronize do
super(key)
end
end

def invalidate_data(user_id)
if @user_hash
# get the array of sessions that contain this user
user_session = nil
user_sessions = @user_hash[user_id] #get the array of
tracked sessions for this user

user_sessions.each do |session_id|
session = self[session_id]
unless session
#this session no longer exists, stop tracking the session
@user_hash[user_id] = user_sessions.delete(session)
return
end
session['user_state'] = "INVALID"
self[session_id] = session
end
end
end

end

DRb.start_service('druby://127.0.0.1:9192', session_hash)
DRb.thread.join
======drb_store.rb========
# this is a simple CGI Session class that contains a
# drb client
require 'cgi'
require 'cgi/session'
require 'drb'

SERVER_URL = 'druby://localhost:9192'

class CGI #:nodoc:all
class Session
class DRbStore
@@session_data = DRbObject.new(nil, SERVER_URL)

def initialize(session, option=nil)
@session_id = session.session_id
end

def restore
@h = @@session_data[@session_id] || {}
end

def update
@h.extend DRbUndumped #comment this line for Marshaling
@@session_data[@session_id] = @h
end

def close
update
end

def delete
@@session_data.delete(@session_id)
end

end
end
end
======/end files/=======

Please, if anyone can help, I'd be most grateful.

Sean

3 Answers

Kornet / Yaako Warrior from AUZ, Korea, Germany, RSA, USA, Sweden, Hong Kong, Canada, Russia, China,

12/10/2009 11:07:00 PM

0

On Dec 11, 8:38 am, "SPierce" <ecre...@bigpond.net.au> wrote:
> "ralph" <rstead...@geocities.com> wrote in message
>
> news:trp2i5hegfc5n35a5tebgc0ci09hhjqm39@4ax.com...
> (snipped)>
> > The conference began on Monday and finishes on December 18.
>
> > It's being held to try to seal a new deal on global warming.
>
> It's to do with transferring white man's tax money to the blacks.   Which
> means taxing the white man more to do this.   And,  it's the white man who
> is going to rip you off in the process...'to be fair'.
>
> This process of course will perpetuate the black man to forever be dependent
> on the white man.  Why would they do anything for themselves to lose the
> handouts.

you must be joking stan

western govenments give nothing to blacks

they promise the world but GIVE nothing

So called AID money is used to EMPLOY undercover agents in white mans
countries and pay for their travel and accom and living expenses to
travel to poor countries to infiltrate and destroy Black mans country

They call it AID to the poor , but not one dollar reaches to poor ,
they ALWAYS end up poorer , the capitalist white christians and jews
ALWAYS end up richer andpeople like YOU always pretend you are helping
poor blacks

No gain to anybody except the undercover agents enjoy travel and first
class accom and expense card for YEARS wandering to globe on endless
HOLIDAYS

you can go look at what happened to the money , it never reached the
blacks , never has , over 90% of it NEVER leaves the white mans
shores , a few coins are used to get the propaganda snaps of food hand
outs for the cameras , they the death squads can go to work and STEAL
the assets of the poor once they have been herded into the kill zone
and their leaders arrested and removed the women and children can be
used as cheap labor while they can still work then they too can be
euthanasia

War is WAR no matter what white christians and jews dress it up as "
helping " people , like pretending the war in Iraq and Afghanistan or
East Timore was done for good reasons we all KNOW its a land / oil
grab by USA and Israel

Melvin Jones says leaving 3,000 carcasses to rot near the community
could cause a potential health hazard of its own.

same methods the white christians and jews always use , like they did
in the 1800s all around the world Docker River is simply another
Wybalena GENOCIDE centre ,out of sight but NEVER to be forgotten or
forgiven EVER , future generations WILL know the truth , justice WILL
be had if it takes another 1000 years
In 1833, the remnants of the Tasmanian Aboriginal population were
exiled to Settlement Point (or Wybalenna, meaning Black Man's House)
on Flinders Island. These 160 survivors were deemed to be safe from
white settlers here, but the relocation scheme was short-lived and
doomed to fail. In 1847 the remaining 47 Aboriginals were again
relocated, this time to Oyster Cove Station, an ex-convict settlement
http://en.wikipedia.org/wiki/Tasmanian_A...
http://en.wikipedia.org/wiki/Kaltukatjara,_Northern...



"This camel massacre in itself is a terrible waste but you're going
to cause a massive potential disease problem with the infestation of
blowflies and with the encroaching wet season," he said.


You're going to have a lot of water running through that country and
there's going to be contamination in various water courses , the flies
will kill off most of the Aborigines and the rotting camel carcasses
will contaminate the waters to keep all Aboriginals away long enough
for USA and Israeli miners to STEAL the land.

> blowflys will give away the criminals behavior , they will be in
> plague proportions by Xmas , expect a few extra visitors at xmas
> dinner.
> at:http://docs.google.com/View?id=dcgk9t7p_2...

The Draft Feral Camel Action Plan does not deal explicitly with the
development of a camel industry.they are not interested in developing
an income from ther camels , just KILL them ASAP to keep aboriginals
poor


The exploration and development of markets for camel products and by-
products is a matter for the camel industry and individual
entrepreneurs.
http://www.environment.gov.au/biodiversity/invasive/ferals/camels/...

Draft Feral Camel Action Plan
Public consultation set up after the shooting starts , and accept the
complaints while the gunmen destroy the potential for
commercialization

The Natural Resources Management Ministerial Council has agreed to the
release of the Draft Feral Camel Action Plan for public consultation
for the period 1 December 2009 to 30 January 2010., while everybody
who can stop this madness enjoys xmas with their families and media is
in holidays the massacre can proceed quietly , to secure full control
of Aboriginals lands and oppress the Aboriginal peoples into deeper
and deeper poverty pretending to " help "
http://www.environment.gov.au/biodiversity/invasive/ferals/camels/...

Desert Knowledge Cooperative Research Centre to develop a national
management framework became the basis for a proposal by Ninti One Ltd
(as the commercial arm of the Desert Knowledge CRC) to remove 670,000
camels over four years and another 500,000 camels in the following
four years with 19 million taxpayers dollars to fund the USA and
Israeli agents expenses

Download

* Draft Feral Camel Action Plan (PDF - 1984KB) (RTF - 562KB)
*

About the plan

The Draft Feral Camel Action Plan has been developed to address four
key outcomes:

* The development of the Australian and international community's
understanding of and support for the management of feral camels and
their impacts
* Amelioration of the negative impacts of feral camels by
addressing the current over-abundance of feral camels through the
immediate and substantial reduction in their numbers across the
rangelands
* Adoption of a platform for the on-going long-term management of
camels, and
* The development of partnerships and social capacities for camel
management into the future.

The Draft Feral Camel Action Plan has been developed as a plan for an
Existing Pest Animal of National Significance (EPANS) under the
Australian Pest Animal Strategy.

The Draft Camel Action Plan is a general agreement between the Western
Australian, South Australian, Northern Territory, Queensland and the
Australian governments to manage the impacts of feral camels. The
Action Plan acknowledges that some actions may be undertaken within
existing budgets and that some will require additional funding.

The Draft Feral Camel Action Plan does not deal explicitly with the
development of a camel industry. The exploration and development of
markets for camel products and by-products is a matter for the camel
industry and individual entrepreneurs.
Guidelines for submissions

Please download the cover sheet and the comments sheet and fill in the
details.

Important: A cover sheet must accompany all submissions
Download

* Cover sheet (PDF - 68KB) (RTF - 62KB)
* Comments sheet (RTF - 32KB)

Where to send your submissions
http://www.environment.gov.au/biodiversity/invasive/ferals/camels/...

Return BOTH the cover sheet and the comments sheet by email or mail
to:

Email: feralcamelactionplan@environment.gov.au
Director
Environmental Biosecurity
GPO Box 787
Canberra ACT 2601

Sad joke to call for Public comment but reject any plan from
commercial operators and start culling before public can comment


Camel slaughter begins
http://www.topnews.in/files/Camel-H...


http://www.topnews.in/files/Camel-H...

Most Aboriginal Residents do not want to see animals go to waste and
camels for many in Docker River have a religious significance.


He says the locals feel bad about the cull. but the whites wont let
camels drink the cattle's water


The Central Land Council is coordinating the cull and has organized
for a helicopter to begin mustering the camels away from Docker River
so thousands can be shot and left to rot away from tourists eyes


blowflys will give away the criminals behavior , they will be in
plague proportions by Xmas , expect a few extra visitors at xmas
dinner.
at: http://docs.google.com/View?id=dcgk9t7p_2...

Docker River local Lyle Kenny poses for photos with his pet camel
Lasseter on December 7, 2009. (ABC News: Sara Everingham)


Docker River local Lyle Kenny poses for photos with his pet camel
Lasseter

Tough decision: Docker River local Lyle Kenny poses for photos with
his camel Lasseter , adopted after its mum was gunned down in last
massacre
http://www.abc.net.au/news/stories/2009/12/08/2764631.htm?sect...

(ABC News: Sara Everingham)


PICS , Camel cull Australia google search
http://images.google.com.au/images?gbv=2&hl=en&client=firefox-a&rls=org.mozilla:en-US:official&q=camel+cull+australia&sa=N&start=20&a...

Camel shooters in australia asked to try and not shoot too many
Aboriginals if possible until nobody is watching
http://en.wikipedia.org/wiki/List_of_massacres_of_Indigenous_A...

Residents in a remote Northern Territory town say a camel cull is to
go ahead with the slaughter .White christians from USA and jews from
Israel have cut off water for the camels and the aboriginal
communities are now the only place camels can get water , the only way
to get rid of the USA and Israeli gunmen is to let them have their fun
and hope they will go away with their 19 million dollars without
shooting too many aboriginals



What is thought to be Australia's largest cull of feral camels is due
to take place this week near the remote town of Docker River.



At dusk, when the sun sets behind the ranges around Docker River, the
camels begin moving into town. Residents sit on their car bonnets to
watch and children gather around.


The number of camels swells and by the morning there are hundreds.
Resident Lyle Kenny says they come in looking for water.


"[The] last couple of weeks it was 600 camels out here," he said.


"They just walk past on the bitumen... I camp outside sometimes. I
look at them. It is like a movie, you know. Camels just marching along
- about 50 or 30."


Mr Kenny is fond of camels,


A cull of 3,000 feral camels begins this week near the remote Northern
Territory town of Docker River, south-west of Alice Springs.


Hundreds of camels have moved into the town in recent weeks.


But now the organizers of the cull are being criticized because the
3000 camel carcasses will be left to rot in the desert.


blowflys will destroy the summer holiday plans and close down tourism
in Australia for years once visitors see the carnage and blowflys
swarming on their food even in the capital cities
Camel damage

There are signs all around Docker River of the damage the camels
do.Cars are parked near power poles to stop camels bringing them down
and infrastructure for water is broken so the supply is constantly
contaminated.


hundreds visit at a time desperate for water having been blocked by
white from their usual watering points camels simply have no other
water available , and the USA and Israeli gunmen are keen for a bit of
sport having been given 19 million dollars for a shooting holiday in
Australia by dumb Aussie taxpayers they are itching for some real
fun , sadly the gunmen wont be permitted to shoot the aboriginals this
time as their may be too many witness
http://en.wikipedia.org/wiki/List_of_massacres_of_Indigenous_A...




Most Aboriginal Residents do not want to see animals go to waste and
camels for many in Docker River have a religious significance.


He says the locals feel bad about the cull. but the whites wont let
camels drink the cattle's water


The Central Land Council is coordinating the cull and has organized
for a helicopter to begin mustering the camels away from Docker River
so thousands can be shot and left to rot away from tourists eyes


blowflys will give away the criminals behavior , they will be in
plague proportions by Xmas , expect a few extra visitors at xmas
dinner.
at: http://docs.google.com/View?id=dcgk9t7p_2...

A former Northern Territory police officer who ran a major cattle
disease inquiry in the 1980s says next week's Government-funded camel
cull is potentially hazardous.


About 3,000 camels are due to be shot by a marksman near the Docker
River community on the Northern Territory - Western Australian border
where the animals are causing havoc for local residents.



Melvin Jones says leaving 3,000 carcasses to rot near the community
could cause a potential health hazard of its own.


"This in itself is a terrible waste but you're going to cause a
massive potential disease problem with the infestation of blowflies
and with the encroaching wet season," he said.


You're going to have a lot of water running through that country and
there's going to be contamination in various water courses , the flies
will kill off most of the Aborigines and the rotting camel carcasses
will contaminate the waters to keep all Aboriginals away long enough
for USA and Israeli miners to STEAL the land.


"I just think it's a very EVIL program." Australian taxpayers should
ALL be charged with genocide for funding it and permitting it to
happen while they watch football and cricket on TV


Tourists who choose to help fund these crimes are also GUILTY of
Genocide
Pilbara camel cull continues in Western Australia as well

Posted 9 hours 9 minutes ago

* Map: Karratha 6714

The Department of Agriculture expects to have killed 2,000 wild camels
by the end of week in a bid to bring their numbers under control.

Professional shooters have been targeting camels and donkeys from
helicopters in the East Pilbara region since Monday.

It is the second of two culls.

The first killed more than 2,000 animals last month.

The department's Damian Collopy says it is estimated there are almost
500,000 camels in Western Australia and their numbers are doubling
every eight years.

"They do head west at certain times of the year and in certain seasons
chasing water and chasing feed," he said.

.
The investigations by the Desert Knowledge Cooperative Research Centre
to develop a national management framework became the basis for a
proposal by Ninti One Ltd (as the commercial arm of the Desert
Knowledge CRC) to remove 670,000 camels over four years and another
500,000 camels in the following four years

Andy

12/11/2009 9:32:00 PM

0

Stan Pierce has too small a penis for any other use than buggering
little boys. And very small ones at that. Baby girls are slightly too
large.


Dr.SirJohnHoward,AC,WSCMoF<wassim.noujwas\

12/12/2009 4:54:00 AM

0

Andy wrote:
> Stan Pierce has too small a penis for any other use than buggering
> little boys. And very small ones at that.

And you know this from first hand experience, do you?

--
http://www.youtube.com/watch?v=_...
- KRudd at his finest.

"The Labour Party is corrupt beyond redemption!"
- Labour hasbeen Mark Latham in a moment of honest clarity.

"This is the recession we had to have!"
- Paul Keating explaining why he gave Australia another Labour recession.

"Silly old bugger!"
- Well known ACTU pisspot and sometime Labour prime minister Bob Hawke
responding to a pensioner who dared ask for more.

"By 1990, no child will live in poverty"
- Bob Hawke again, desperate to win another election.

"A billion trees ..."
- Borke, pissed as a newt again.

"Well may we say 'God save the Queen' because nothing will save the governor
general!"
- Egotistical shithead and pompous fuckwit E.G. Whitlam whining about his
appointee for Governor General John Kerr.

"SHUT THE FUCK UP YOU DUMB CUNT!"
- FlangesBum on learning the truth about Labour's economic capabilities.

"I don't care what you fuckers think!"
- KRudd the KRude Rat at his finest again.

"We'll just change it all when we get in."
- Garrett the carrott