2010年6月4号--SGS-RedDwarf之ClientSession
Interface ClientSession
ClientSession对象代表在客户端与服务器之间的一个单例的、已连接的login session。所有实现了ClientSession的类也必须实现Serializable接口。
当一个客户端进入应用程序之后,应用程序的AppListener.loggedIn方法被调用,并且一个代表着当前客户端与服务器之间的新的ClientSession作为其参数。并且从该方法为每一个作为参数的ClientSession返回一个唯一的ClientSessionListener,应用程序会在客户端即ClientSession发送消息或者断开连接或者logs out登出应用程序时,获得通知。为了明确的断开一个ClientSession连接,会调用DataManager.removeObject方法从data manager中移除和该clientsession先关联的clientsession对象。
英文原文(来自RedDwarf Server 0.10.1 External API):
Interface representing a single, connected login session between a client and the server. Classes that implement ClientSession must also implement Serializable.
When a client logs in, the application's AppListener.loggedIn method is invoked with a new ClientSession instance which represents the current connection between that client and the server. By returning a unique ClientSessionListener from the loggedIn method for each given client session, the application will receive notification when a client session sends a message, is disconnected, or logs out. To explicitly disconnect a ClientSession, remove the associated ClientSession object from the data manager using the DataManager.removeObject method.
Interface DataManager
提供方法来管理实现共享和持久化数据。(提供方法实现共享和持久化数据的实现。)被管理的数据时那些实现了ManagedObject和Serializable接口的对象。每一个被管理的对象都和被它所引用的所有可串行化的(Serializable)和notManaged对象一起被分离开来保存。如果一个ManagedObject对象引用另一个ManagedObject对象,那么它就必须通过一个用createReference方法创建的ManagedReference来实现。如果不这样做,也就是说尝试通过标准的引用而不是ManagedReference保存一个managed的对象的引用,那么将会导致ObjectIOException异常的抛出。
绑定与names的Managed对象以及所有它们直接或间接所引用的Managed对象,都是由DataManaged保存的。并且由应用程序决定那些Managed对象是不在需要的并且何时把它们从ManagedData中移除出去。
英文原文:
Provides facilities for managing access to shared, persistent objects. Managed objects are objects that implement the ManagedObject and Serializable interfaces. Each managed object is stored separately along with all of the serializable, non-managed objects it refers to. If a managed object refers to another managed object, it must do so through an instance of ManagedReference, created by the createReference method. Attempting to store a reference to a managed object using a standard reference rather than an instance of ManagedReference will typically result in an ObjectIOException being thrown when the current transaction commits.
Managed objects that are bound to names, and any managed objects they refer to directly or indirectly, are stored by the DataManager. It is up to the application to determine when managed objects are no longer needed and to remove them explicitly from the DataManager using the removeObject method.
分享到:
相关推荐
一个简单的scotty库,它从cookie读取加密的会话字符串并将会话写入cookie clientsession用于加密和解密
一个紧凑的Java库,用于在客户端(例如浏览器)而非服务器上安全地维护Web客户端状态。 这解决了使用服务器会话的许多问题,例如超时,内存使用,网络延迟(使用群集)
ws.clientSession(URL) 创建一个新的websocket会话。 该url的格式可以为“ ws:// localhost”,也可以作为对象传递。 它基于 。 ws.clientSession与libchan不兼容。 多亏了该方法也可以在浏览器中工作。 例子...
带有客户端的完整这是FastAPI的一个示例,但是您可以将此逻辑与任何异步(ASGI)Web框架一起使用实现的逻辑: (带有aiohttp的假服务器模拟答案) 在FastAPI启动时打开ClientSession 在fastAPI关闭时关闭...
php$ client = new \ Ytake \ PrestoClient \ StatementClient ( new \ Ytake \ PrestoClient \ ClientSession ( 'http://localhost:8080/' , 'acme' ), 'SELECT * FROM acme.acme.acme');// execute http request$ ...
当前状态是aiohttp.ClientSession替换(或mixin),具有多个异步缓存后端。 在1.0发行之前,应该预期会有重大更改,因此建议版本固定。 我在开发此代码的同时还维护了 ,最终目标是在两个库之间设置相似(但不完全...
prepQuery ( { text : `select * from users where id = $1` , type : [ 'int' ] , values : [ clientSession . uid ] } , ( err , result ) => { if ( err ) { return cb ( err ) } if ( ! result . rowCount
客户端会话在req.clientSession ,类似于 connect/express 中常规会话状态的req.session 。 如果你有一些应该可以在客户端访问的会话状态,但你不想在返回服务器时接受任何信息修改,你可以将它存储在req.session并...
该软件包支持官方API的所有端点: 开发过程:安装pip install asyncio-hn用法import asynciofrom asyncio_hn import ClientHNasync def main ( loop ): # We init the client - extension of aiohttp.ClientSession ...
/ client_session /初始化的aiohttp.ClientSession 。 (默认: None ,创建新会话。)访问控制助手方法onyx_client.helpers.exchange_code使用API代码并执行到指纹和访问令牌的交换。 请按照上述文档检索代码。...
异步执行器版本:0.0.4 状态:开发人员作者:hsz 电子邮件: 描述用于运行协程的Asyncio执行程序... ClientSession () as session : async with session . get ( url ) as resp : html = await resp . text ( "utf-8"
ClientSession () as client_session : client = aio_request . setup ( transport = aio_request . AioHttpTransport ( client_session ), endpoint = "http://endpoint:8080/" , ) response_ctx = client . ...
async with session.get(url) as resp:async with aiohttp.ClientSession() ascontent
客户端入门要从Web上获取内容,请执行以下操作:导入aiohttp导入asyncio async def main():以aiohttp.ClientSession()作为会话进行异步:以session.get('http://python.org')作为响应进行异步:
import aiohttp import asyncio async def fetch(session, url): async with session.get(url) as response: return await response.text() async def main(): async with aiohttp .ClientSession() 作为会话:...
aiochclient 适用于python 3.6+的异步httpClickClick客户端,支持双向... 快速开始 连接到ClickHouse aiochclient需要aiohttp.ClientSession才能连接到ClickHouse: from aiochclient import ChClientfrom aiohttp impo
验证码API 信息 我创建了此API,因此可以将其与一起使用,并且我决定将其公开(开源)。 该API在 (特别是 )上运行。 如果您遇到问题,请告诉我们,矛盾也可以解决。 (ammar#0443) ... ClientSession () as ses
ClientSession cs=(ClientSession)conn; cs.connect(null); 5.从资源中取出图片发送 byte filebytes[]=getImageData("/images/leaf.png"); HeaderSet hs=cs.createHeaderSet(); hs.setHeader(HeaderSet.NAME,...
ClientSessionfrom gios import ApiError , InvalidSensorsData , Gios , NoStationErrorGIOS_STATION_ID = 117async def main (): try : async with ClientSession () as websession : gios = Gios ( GIOS_STATION...
from aiohttp import ClientError , ClientSession REGION = 9 logging . basicConfig ( level = logging . DEBUG ) async def main (): async with ClientSession () as websession : try : zadnegoale = ...