본문 바로가기

Push3

[ReactJS] add component in list 동적으로 리스트 안의 값을 추가하여 보여줘야 하는 경우가 있다. ReactJS 에서는 render() 안의 값을 동적으로 보여주기 위해서는 state 를 이용해야 한다. import React from 'react';import TmpComponent from './TmpComponent'); export default class TestClass extends React.Component { constructor(props) { super(props); this.state = {resultAjax: [],tmpState: [],checked: [] } } componentDidMount() { // Ajax 호출 ...for (..) {checked[i] = false;this.setState({res.. 2016. 12. 29.
[Python] RabbitMQ Publish Subscribe RabbitMQ 에 Publish/Subscribe 하는 방식입니다.Publishtopic 으로 호출하는 방식import pika import json class Publish(object): def __init__(self): self.connection = None self.channel = None self.topic = None def is_connect(self, host, topic=None): try: self.topic = topic self.connection = pika.BlockingConnection(pika.ConnectionParameters( host=host )) self.channel = self.connection.channel() self.channel.queue_dec.. 2016. 10. 26.
MQTT AMQP RabbitMQ MQTT (MQ Telemetry Transport)MQTT는 경량의 Publish/Subscribe(Pub/Sub) 메시징 프로토콜이다. 네트워크가 불안정한 장소에서 작동하는 기능이나 힘이 약한 장치로 움직이는 기능을 위해 경화한 한 것이 특징이다. M2M(machine-to-machine)와 IoT(Internet of things)에서 사용하려고 만들었다. IoT를 위해서 낮은 전력, 낮은 대역폭 환경에서도 사용할 수 있도록 설계됐다. 이름에서도 알 수 있듯이 부하를 분산시키기위한 Job Queue 기능은 없다. 이러한 용도로는 보통 AMQP 등을 사용한다. 또한 아래의 그림에서 볼 수 있듯이, MQTT는 저전력, 신뢰할 수 없는 네트워크, No TCP/IP 기반에서 운용할 수 있다는 장점이 있다... 2016. 10. 21.