我可以看到像Klarna和Whatsapp这样的两家大公司正在使用Mnesia作为他们的内存数据库(不确定他们如何将数据保持在Mnesia的2GB限制).我的问题是:为什么公司喜欢这些,可能更多我不知道,使用Mnesia而不是Riak或couchDB,两者都是Erlang,两个数据库都支持更快的内存数据库,更好的无痛持久性和更多功能.我在这里想念一下吗?
我正在尝试通过websocket连接发送会话ID(我在对http服务器进行身份验证后得到它)(我使用的是python websocket客户端),我需要将其作为头参数传递,其中服务器(Tornado Websocket服务器)将读取所有标题并检查它们.
问题是:如何使用现有的客户端python Websocket实现添加标头,我发现它们都不能做到这一点,或者我是否首先采用了错误的方法进行身份验证?
- 更新 -,在我使用的代码模板下面:
def on_message(ws, message):
print 'message received ..'
print message
def on_error(ws, error):
print 'error happened .. '
print error
def on_close(ws):
print "### closed ###"
def on_open(ws):
print 'Opening Websocket connection to the server ... '
## This session_key I got, need to be passed over websocket header isntad of ws.send.
ws.send(session_key)
if __name__ == "__main__":
websocket.enableTrace(True)
ws = websocket.WebSocketApp("ws://localhost:9999/track",
on_open = on_open,
on_message = on_message,
on_error = on_error, …Run Code Online (Sandbox Code Playgroud) 如何在Tornado上设置WSS(Secure WebSockets)?
在他们的文档中,他们说以下内容:
WebSocketHandler.get_websocket_scheme可用于在未正确设置的情况下选择适当的URL方案(ws://或wss://) HTTPRequest.protocol.
那么,我如何使用get_websocket_scheme和/或HTTPRequest.protocol让WSS在Tornado上工作.
我只创建了下表中Rabbitmq管理Webui中显示的最后2个队列名称:

表的其余部分有类似哈希的队列,我不知道:
Run Code Online (Sandbox Code Playgroud)1- Who created them? (I know it is celery, but which process, task,etc.) 2- Why they are created, and what they are created for?.
我可以注意到,当推送消息的数量增加时,这些类似哈希的消息的数量会增加.
我有一个问题handeling http chunked传输编码.
我正在使用:
django只能处理带有content-length头字段的reqular http请求,但是当处理TE(Transfer-Encoding),chunked或gzip时,它返回一个空结果.
我正在考虑两种方法:
任何人都可以提供上述2种选择中的任何一种(当然更受欢迎的选项)
谢谢!
在格雷厄姆的第一次调查之后,这是对我的问题的延伸:
首先,感谢您的快速反应.正在使用的客户是Axis,它是另一家公司与我们沟通的系统的一部分.我已经WSGIChunkedRequest On设置了,我也对我的wsgi包装做了一些修改,如下所示:
def application(environ, start_response):
if environ.get("mod_wsgi.input_chunked") == "1":
stream = environ["wsgi.input"]
print stream
print 'type: ', type(stream)
length = 0
for byte in stream:
length+=1
#print length
environ["CONTENT_LENGTH"] = len(stream.read(length))
django_application = get_wsgi_application()
return django_application(environ, start_response)
Run Code Online (Sandbox Code Playgroud)
但它给了我那些错误(从apache的error.log文件中提取):
[Sat Aug 25 17:26:07 2012] [error] <mod_wsgi.Input object at 0xb6c35390>
[Sat Aug 25 17:26:07 2012] [error] type: <type 'mod_wsgi.Input'>
[Sat Aug 25 17:26:08 …Run Code Online (Sandbox Code Playgroud) 我有一个用celery @task装饰方法的类,如下所示:
class Port(object):
"""docstring for Port"""
def __init__(self,):
print 'Class has been initialized ...'
@celery.task(filter=task_method,name="Port.process")
def process(self,):
print "I'm inside the process task method: "
Run Code Online (Sandbox Code Playgroud)
叫这里:
p = Port()
p.process.apply_async()
Run Code Online (Sandbox Code Playgroud)
我也试过:p.process.delay(),结果如下.
当我运行它时,我收到此错误:
[2013-06-22 02:32:53,988: ERROR/MainProcess] Task Port.process[77cff07e-4bc5-4e36-9c4e-b68d7616c74e] raised exception: TypeError('process() takes at least 1 argument (0 given)',)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/celery/task/trace.py", line 228, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/celery/task/trace.py", line 415, in __protected_call__
return self.run(*args, **kwargs)
TypeError: process() takes at …
如果其中一项任务失败,那么如果整个连锁店断裂,芹菜链的重点是什么?!!
我有这个芹菜链:
res = chain(workme.s ( y=1111 ), workme2.s( 2222 ), workme3.s( 3333 ),)()
Run Code Online (Sandbox Code Playgroud)
我使workme2失败,重试如下:
@celery.task(default_retry_delay=5, max_retries = 10, queue="sure")
def workme2(x,y):
# try:
try:
print str(y)
sleep(2)
print str(x)
## adding any condition that makes the task fail
if x!=None:
raise Exception('Aproblem from your workme task')
print 'This is my username: ' + str(x['user']) + \
' And Password: ' + str(x['pas'])
return "22xx"
except Exception, exc:
workme2.retry(args=[x,y], exc=exc,)
Run Code Online (Sandbox Code Playgroud) 实际上,Dropbox做得非常好,他们能够保护他们用python制作的桌面应用程序; 我对此进行了很多研究,但没有比混淆更好的解决方案,这不是很安全的方法,你最终会看到你的代码上传到某个地方.
我听了Giovanni Bajo(PyInstaller创始人)的一次会议,他说Dropbox这样做:
define
loadup 8.我从来没有通过Python的源代码,所以,我不会声称我完全理解上面的单词.
我需要听听专家的声音:怎么做这样的事情?如果重新编译之后,我将能够使用PyInstaller等可用工具打包我的应用程序?
更新:
我对Dropbox如何进行这种混淆/变异做了一些研究,我发现了这个:
根据Hagen Fritsch的说法,他们分两个阶段完成:
它们使用TEA密码以及每个python模块的代码对象中的某些值播种的RNG.他们相应地调整了解释器
a)解密模块和
b)阻止访问解密的代码对象.
这将是直接的路径,让dropbox解密所有内容并使用内置marshaller转储模块.
使用的另一个技巧是手动加扰操作码.不幸的是,这只能半自动修复,因此他们的单字母替代密码证明在赢得一些时间方面非常有效.
我仍然想要更多的见解如何做到这一点,更重要的是,我不知道在这个过程中解密是如何发生的......我想要所有专家的声音......普通人你在哪里.
C ++中是否存在像python中那样的自省技术?
例如:我想获得有关特定对象的更多信息,而无需遍历头文件或参考cpp参考。
我是在问一个正确的问题,还是在这里错误的方向?
更新:
根据以下答案,此答案与我的问题有关:如何向C ++应用程序添加反射?
据说原子不是垃圾收集的.一旦你创建了一个原子,它就会保留在原子表中,这可能会在一天结束时导致内存泄漏!
我对Erlang很新,我的问题是:原子如何被垃圾收集?如果不可能,如何最大限度地减少这种影响?