http://52.36.50.145:8080/MainServlet?orgName=XXX&userName=XXX&password=XXX&mobileNo=967777662112&text= msg +“&coding = 2”
我有那个网址,如何为多用户codeigntor发送发送短信
答案 0 :(得分:1)
您必须在rdd2 = rdd1.map(lambda x:(x[0],(x[1],x[3])))
rdd3 = rdd2.reduceByKey(lambda x,y:(x[0],min(x[1],y[1])))
中使用public class CommunicationThreadFactory implements ThreadFactory {
@Override
public Thread newThread(Runnable runnable){
Thread thread=new Thread(runnable);
return thread;
}
}
public class ThreadEx implements Runnable {
private byte[] pack;
private final BlockingQueue writeBlockingQueue;
public Writer(BlockingQueue writeBlockingQueue, byte[] pack) {
this.writeBlockingQueue = writeBlockingQueue;
this.pack = pack;
}
@Override
public void run() {
TimeUnit.SECONDS.sleep(1);//Even this line block it wont process below this line. Even after time out.
writeBlockingQueue.put(pack);//Tried even with disabling put and takes from queue. still did not work
System.out.println("In Thread "+Thread.currentThread().getName() +" got "+ this.pack.length);// This line does not even produce output.
writeBlockingQueue.take();
}
}
public static void main(String[] args) throws UnsupportedEncodingException {
ExecutorService connectionThreadPool = Executors.newFixedThreadPool(15,new
CommunicationThreadFactory());
BlockingQueue<byte[]> blockingQueue = new ArrayBlockingQueue<>(10, true);
byte[] packet = new byte[]{0x63, 0x41, 0x35, 0x19};
for (int i = 0; i < 10; i++) {
connectionThreadPool.execute(new ThreadEx());
}
}
。此功能适用于发送短信。
cURL