Hi,
Thank you very much for this example with EventHandler. I didn't know about it 
and wanted to implement asynchronous display refresh my way - I wanted to 
create thread that would receive data from ttb and update view without freezing 
all GUI. Tomorrow I'll try to use EventHandlers.
I wanted to create another node for tracing application because I was thinking 
about tracing multiple nodes in the same time. And I thought that it's better 
when tracing application runs on completely different node than on one of which 
are being traced. Another reason is amount of trace data which is being 
generated - when tracing application runs on same node your tracing results 
will be "polluted" with events generated by it.
So could you explain me how can I create new node (what arguments should I pass 
to BackendManager.createBackend) on which I could start something (ttb in this 
case)?
regards,
Piotrek


> Hi,
> 
> In order to start another node, you have to use
> BackendManager.createBackend. (OtpNode will not start a beam process
> and other ways will not make the beam process die when the Eclipse
> instance shuts down). But I don't think it would be useful in this
> case: the node will run on the same machine, so the processing will
> take just as much. The problem is that we don't want to have to wait
> for the trace data, but start the processing asynchronously and get
> notified when it's ready.
> 
> I think that the way to do it is to update the view in the background
> using events. Something like this
> 
>       public class TraceEventHandler extends EventHandler {
> 
>               @Override
>               protected void doHandleMsg(final OtpErlangObject msg) throws
> Exception {
>                       final OtpErlangObject event = getStandardEvent(msg, 
> "trace_ttb");
>                       if (event == null) {
>                               return;
>                       }
>                       // ErlLogger.debug("************>>> " + event);
>                         // get item from event and add it to the
> viewer data
>               }
>       }
> 
> // somewhere in the view
>                       handler = new TraceEventHandler();
>                       backend.getEventDaemon().addHandler(handler);
> 
> 
> %% for the time being this has to be added to erlide_jrpc:init/1
>       add_service(io_server, JPid),
> 
> %% use this to send
> send_event(String, From) ->
>       erlide_jrpc:event(trace_ttb, TraceData).
> 
> Check how it's done for ProcessEventHandler, which updates the
> Process
> list view.
> 
> regards,
> Vlad

------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Erlide-devel mailing list
Erlide-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlide-devel

Reply via email to