本文整理匯總了TypeScript中@jupyterlab/services.SessionManager.startNew方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SessionManager.startNew方法的具體用法?TypeScript SessionManager.startNew怎麽用?TypeScript SessionManager.startNew使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@jupyterlab/services.SessionManager
的用法示例。
在下文中一共展示了SessionManager.startNew方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should connect to an existing session on the path', async () => {
const other = await manager.startNew({ path: session.path });
await session.initialize();
expect(other.kernel.id).to.equal(session.kernel.id);
other.dispose();
});
示例2: it
it('should connect to an existing session on the path', () => {
let other: Session.ISession;
return manager.startNew({ path: session.path }).then(o => {
other = o;
return session.initialize();
}).then(() => {
expect(session.kernel.id).to.be(other.kernel.id);
return other.dispose();
});
});
示例3: it
it('should connect to an existing kernel', async () => {
// Shut down and dispose the session so it can be re-instantiated.
await session.shutdown();
session.dispose();
const other = await manager.startNew({ path: UUID.uuid4() });
const kernelPreference = { id: other.kernel.id };
session = new ClientSession({ manager, kernelPreference });
await session.initialize();
expect(session.kernel.id).to.equal(other.kernel.id);
// We don't call other.shutdown() here because that
// is handled by the afterEach() handler above.
other.dispose();
});