BIOS: EC-ARB20A-1.15-T01
Proxmox VE: 7.3-1
BIOS: EC-ARB20A-1.15-T01
Proxmox VE: 7.3-1
| """ | |
| Example of redis channels pub/sub for aiohttp microservices using aioredis | |
| Another example - https://aioredis.readthedocs.io/en/latest/examples.html#pub-sub-example | |
| """ | |
| """ | |
| Service pub. | |
| Publish some json test data into channel by api call |
| def add(x, y=2): | |
| return x + y | |
| def product(x, y=2): | |
| return x * y |
| admin.addPeer("enode://cd24a0c66055d788ce2bb77c2525915724a56de577b3e39c1a4dde347e60c83f082285a9d43a5ba0d7efc929699106d147e8d3612baafcaeb8f3075f36a82670@180.64.84.98:51044"); | |
| admin.addPeer("enode://86fb5f9e216c9fef5f97d3140d8d30ba13e2cc615ebb0b8e22975d296486e1f589baa6a2a4db6e0a1482f9b27a9e472efd94ec01cefc6e1d7e687dcdda0af5cc@46.105.118.30:30333"); |
| import asyncio | |
| import json | |
| import logging | |
| import signal | |
| import aiohttp | |
| import platform | |
| from aiohttp import web | |
| from datetime import datetime | |
| from nats.aio.client import Client as NATS |
| # -*- coding: utf-8 -*- | |
| """ | |
| +++ bitFlyerのRealtime API(JSON-RPC 2.0 over WebSocket)をaiohttpのWebsokectを用いて取得する | |
| """ | |
| import aiohttp | |
| import asyncio | |
| import json | |
| class bfDataReceiver(object): |
| from flask import Flask | |
| from flask_restful import Api, Resource, reqparse | |
| app = Flask(__name__) | |
| api = Api(app) | |
| users = [ | |
| { | |
| "name": "Nicholas", | |
| "age": 42, |
| from flask import Flask | |
| from flask import request | |
| import json | |
| import requests | |
| import hashlib as hasher | |
| import datetime as date | |
| node = Flask(__name__) | |
| # Define what a Snakecoin block is | |
| class Block: |
| import asyncio | |
| import random | |
| class Hub(): | |
| def __init__(self): | |
| self.subscriptions = set() | |
| def publish(self, message): |