-*- outline -*-
non-independent things left to do on newpb. These require deeper magic or
can not otherwise be done casually. Many of these involve fundamental
protocol issues, and therefore need to be decided sooner rather than later.
* summary
** protocol issues
*** negotiation
*** VOCABADD/DEL/SET sequences
*** remove 'copy' prefix from RemoteCopy type sequences?
*** smaller scope for OPEN-counter reference numbers?
** implementation issues
*** cred
*** oldbanana compatibility
*** Copyable/RemoteCopy default to __getstate__ or self.__dict__ ?
*** RIFoo['bar'] vs RIFoo.bar (should RemoteInterface inherit from Interface?)
*** constrain ReferenceUnslicer
*** serialize target.remote_foo usefully
* decide whether to accept positional args in non-constrained methods
DEFERRED until after 2.0
<glyph> warner: that would be awesome but let's do it _later_
This is really a backwards-source-compatibility issue. In newpb, the
preferred way of invoking callRemote() is with kwargs exclusively: glyph's
felt positional arguments are more fragile. If the client has a
RemoteInterface, then they can convert any positional arguments into keyword
arguments before sending the request.
The question is what to do when the client is not using a RemoteInterface.
Until recently, callRemote("bar") would try to find a matching RI. I changed
that to have callRemote("bar") never use an RI, and instead you would use
callRemote(RIFoo['bar']) to indicate that you want argument-checking.
That makes positional arguments problematic in more situations than they were
before. The decision to be made is if the OPEN(call) sequence should provide
a way to convey positional args to the server (probably with numeric "names"
in the (argname, argvalue) tuples). If we do this, the server (which always
has the RemoteInterface) can do the positional-to-keyword mapping. But
putting this in the protocol will oblige other implementations to handle them
too.
* change the method-call syntax to include an interfacename
DONE
Scope the method name to the interface. This implies (I think) one of two
things:
callRemote() must take a RemoteInterface argument
each RemoteReference handles just a single Interface
Probably the latter, maybe have the RR keep both default RI and a list of
all implemented ones, then adapting the RR to a new RI can be a simple copy
(and change of the default one) if the Referenceable knows about the RI.
Otherwise something on the local side will need to adapt one RI to another.
Need to handle reference-counting/DECREF properly for these shared RRs.
From glyph:
callRemote(methname, **args) # searches RIs
callRemoteInterface(remoteinterface, methname, **args) # single RI
getRemoteURL(url, *interfaces)
URL-RRefs should turn into the original Referenceable (in args/results)
(map through the factory's table upon receipt)
URL-RRefs will not survive round trips. leave reference exchange for later.
(like def remote_foo(): return GlobalReference(self) )
move method-invocation code into pb.Referenceable (or IReferenceable
adapter). Continue using remote_ prefix for now, but make it a property of
that code so it can change easily.
<warner> ok, for today I'm just going to stick with remote_foo() as a
low-budget decorator, so the current restrictions are 1: subclass
pb.Referenceable, 2: implements() a RemoteInterface with method named "foo",
3: implement a remote_foo method
<warner> and #1 will probably go away within a week or two, to be replaced by
#1a: subclass pb.Referenceable OR #1b: register an IReferenceable adapter
try serializing with ISliceable first, then try IReferenceable. The
IReferenceable adapter must implements() some RemoteInterfaces and gets
serialized with a MyReferenceSlicer.
http://svn.twistedmatrix.com/cvs/trunk/pynfo/admin.py?view=markup&rev=44&root=pynfo
** use the methods of the RemoteInterface as the "method name"
DONE (provisional), using RIFoo['add']
rr.callRemote(RIFoo.add, **args)
Nice and concise. However, #twisted doesn't like it, adding/using arbitrary
attributes of Interfaces is not clean (think about IFoo.implements colliding
with RIFoo.something).
rr.callRemote(RIFoo['add'], **args)
RIFoo(rr).callRemote('add', **args)
adaptation, or narrowing?
<warner> glyph: I'm adding callRemote(RIFoo.bar, **args) to newpb right now
<radix> wow.
<warner> seemed like a simpler interface than callRemoteInterface("RIFoo",
"bar", **args)
<radix> warner: Does this mean that IPerspective can be parameterized now?
<glyph> warner: bad idea
<exarkun> warner: Zope hates you!
<glyph> warner: zope interfaces don't support that syntax
<slyphon> zi does support multi-adapter syntax
<slyphon> but i don't really know what that is
<exarkun> warner: callRemote(RIFoo.getDescriptionFor("bar"), *a, **k)
<warner> glyph: yeah, I fake it. In RemoteInterfaceClass, I remove those
attributes, call InterfaceClass, and then put them all back in
<glyph> warner: don't add 'em as attributes
<glyph> warner: just fix the result of __getitem__ to add a slot actually
refer back to the interface
<glyph> radix: the problem is that IFoo['bar'] doesn't point back to IFoo
<glyph> warner: even better, make them callable :-)
<exarkun> glyph: IFoo['bar'].interface == 'IFoo'
<glyph> RIFoo['bar']('hello')
<warner> glyph: I was thinking of doing that in a later version of
RemoteInterface
<glyph> exarkun: >>> type(IFoo['bar'].interface)
<glyph> <type 'str'>
<exarkun> right
<exarkun> 'IFoo'
<exarkun> Just look through all the defined interfaces for ones with matching
names
<glyph> exarkun: ... e.g. *NOT* __main__.IFoo
<glyph> exarkun: AAAA you die
<radix> hee hee
* warner struggles to keep up with his thoughts and those of people around him
* glyph realizes he has been given the power to whine
<warner> glyph: ok, so with RemoteInterface.__getitem__, you could still do
rr.callRemote(RIFoo.bar, **kw), right?
<warner> was your objection to the interface or to the implementation?
<itamar> I really don't think you should add attributes to the interface
<warner> ok
<warner> I need to stash a table of method schemas somewhere
<itamar> just make __getitem__ return better type of object
<itamar> and ideally if this is generic we can get it into upstream
<exarkun> Is there a reason Method.interface isn't a fully qualified name?
<itamar> not necessarily
<itamar> I have commit access to zope.interface
<itamar> if you have any features you want added, post to
interface-dev@zope.org mailing list
<itamar> and if Jim Fulton is ok with them I can add them for you
<warner> hmm
<warner> does using RIFoo.bar to designate a remote method seem reasonable?
<warner> I could always adapt it to something inside callRemote
<warner> something PB-specific, that is
<warner> but that adapter would have to be able to pull a few attributes off
the method (name, schema, reference to the enclosing RemoteInterface)
<warner> and we're really talking about __getattr__ here, not __getitem__,
right?
<exarkun> for x.y yes
<itamar> no, I don't think that's a good idea
<itamar> interfaces have all kinds od methods on them already, for
introspection purposes
<itamar> namespace clashes are the suck
<itamar> unless RIFoo isn't really an Interface
<itamar> hm
<itamar> how about if it were a wrapper around a regular Interface?
<warner> yeah, RemoteInterfaces are kind of a special case
<itamar> RIFoo(IFoo, publishedMethods=['doThis', 'doThat'])
<itamar> s/RIFoo/RIFoo = RemoteInterface(/
<exarkun> I'm confused. Why should you have to specify which methods are
published?
<itamar> SECURITY!
<itamar> not actually necessary though, no
<itamar> and may be overkill
<warner> the only reason I have it derive from Interface is so that we can do
neat adapter tricks in the future
<itamar> that's not contradictory
<itamar> RIFoo(x) would still be able to do magic
<itamar> you wouldn't be able to check if an object provides RIFoo, though
<itamar> which kinda sucks
<itamar> but in any case I am against RIFoo.bar
<warner> pit
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共144个文件
py:82个
changelog:7个
xhtml:7个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
资源分类:Python库 所属语言:Python 资源全名:foolscap-0.2.4.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 144 条
- 1
- 2
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/277f6345dca0446498fbbc03843436aa_qq_38161040.jpg!1)
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)