Archived

This forum has been archived. Please start a new discussion on GitHub.

Creating callbacks on Ruby

Hello!

I'm not really familiar with the framework but I get some results except one thing that I can't find in the documentation or elsewhere.

I try to create a callback for Mumble server using ICE when a user is connected with Ruby bindings. But I can't get the main point how to implement the ServerCallback interface that I have in .ice file in Ruby.

In Python example, an adapter is used for adding a custom class with overrided method but I can't find what approach should be used in Ruby. There is no such method as createObjectAdapter.

On that page of the documentation there is a lot of useful information but none about creating proxies. Only such lines

obj = ... # Get a proxy from somewhere...

And I'm interested exactly where from I should get a proxy :smile: So, I want to create a class with userConnected method, in my case, and convert it somehow to a proxy object that (un)checkedCast method would be satisfied.

I would glad to get any feedback!

P.S. I also tried to use Python and the line from the example doesn't work for me

adapter = communicator.createObjectAdapter("Callback.Client")

I get "object adapter 'Callback.Client' requires configuration" error message. Is the example outdated or it depends on .ice file?

Tagged:

Comments

  • mes
    mes California

    Hi,

    Welcome to the forum.

    Callbacks are a "server-side" activity, and unfortunately the Ruby bindings don't support server-side activities.

    Regarding the Python error: when you call createObjectAdapter("AdapterName"), Ice expects to find the configuration property AdapterName.Endpoints and complains if it's not defined. So you'll either need to set the Callback.Client.Endpoints property to a value (the value tcp is probably sufficient to get started), or you can call createObjectAdapterWithEndpoints instead and supply the endpoint in your code.

    Regards,
    Mark