V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Neo10373  ›  全部回复第 1 页 / 共 1 页
回复总数  2
2021-01-12 08:42:59 +08:00
回复了 hijoker 创建的主题 Go 编程语言 各位老铁,这几个面试问题怎么回答(回答的圆满不)?
第二题更具体点:
无缓存,同时发送和接收时,发送端会阻塞,接收端完成接收,发送端解阻塞完成发送;
有缓冲,发送端阻塞到复制值到缓冲区完成,缓冲区满一直阻塞,接收端阻塞到从缓冲区取值完成,缓冲区空一直阻塞
2020-10-15 09:05:28 +08:00
回复了 knight3r 创建的主题 Django 对同一 viewset 的不同 action 方法不同的 authenticaltion 是否可行?
create,retrieve 等默认 action 是不行的, 会自动使用 UserViewSet 的 authentication_classes,

1. 要么关闭视图类属性的 authentication_classes, 每个 action 内自己使用 JwtAuthorizationAuthentication 进行认证
2. 要么去掉 CreateModelMixin, RetrieveModelMixin, 自己写 action
```
@action(detail=False, authentication_classes=(JwtAuthorizationAuthentication, ))
def my_create(self, request, *args, **kwargs):

@action(detail=True, authentication_classes=())
def my_retrieve(self, request, *args, **kwargs):
```
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5586 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 03:44 · PVG 11:44 · LAX 20:44 · JFK 23:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.