Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/04/2007, 17:06
Avatar de Viet
Viet
 
Fecha de Ingreso: octubre-2003
Ubicación: Mar del Plata - Argentina
Mensajes: 247
Antigüedad: 20 años, 7 meses
Puntos: 2
Servicio Web y Thread(Hilos)

Buenas:

Queria sabes si se puede hacer que un servicio web tenga hilos dentro para algunas tareas y uno de los hilos haga el return(que será el response al cliente)??

Es posible esto???

por ejemplo:

El modo clasico:

Código PHP:
public class Math {
    public 
float add(float afloat b) {
        return 
a+b;
    }

con hilos:

Código PHP:
public class Math {
    public 
float add(float afloat b) {
          
// Create and start the thread
    
Thread thread = new BasicThread1(a,b);
    
thread.start();
    }
}

class 
BasicThread1 extends Thread {
        
// This method is called when the thread runs
        
int a;
        
int b;
        public 
BasicThread1(int a,int b){
            
this.a;
            
this.b;
        }
        public 
void run() {
            return 
a+b;
        }
    } 
Si es posible como hago el return desde un hilo ?????
__________________
Keep it simple and keep it fast.