-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Was just sort of roughing out the structure and API of my new session store with this code:
import times
type
PSessionStore* = ref TSessionStore
TSessionStore = object
sessionsExpireAfter: TTimeInterval
substores: seq[PSubStore]
PSubStore = ref TSubStore
TSubStore = object
sessions: PSessionTree
thread: TThread
PSessionTree = ref TSessionTree
TSessionTree = object
size: int
root: PSession
PSession = ref TSession
TSession = object
id*: string
createdAt*: TTime
parent: PSession
left: PSession
right: PSession
const defaultTimeInterval = initTimeInterval(days = 7)
proc newSessionStore*(sessionsExpireAfter = defaultTimeInterval, threadcount = 4): PSessionStore
proc genSession*(store: PSessionStore): PSession
proc `[]`*(sessionId: string): PSession
proc containsSession*(store: PSessionStore, session: PSession): bool
proc containsSession*(store: PSessionStore, sessionId: string): bool
proc hasExpired*(PSession): boolAnd if try to compile, this happen:
% nimrod c --threads:on sheshonshtore.nim
config/nimrod.cfg(37, 2) Hint: added path: '/Users/isak/.babel/pkgs/babel-0.2.0' [Path]
config/nimrod.cfg(37, 2) Hint: added path: '/Users/isak/.babel/pkgs/aporia-0.2.0' [Path]
config/nimrod.cfg(37, 2) Hint: added path: '/Users/isak/.babel/pkgs/gtk2-1.0' [Path]
config/nimrod.cfg(37, 2) Hint: added path: '/Users/isak/.babel/pkgs/jester-0.1.0' [Path]
config/nimrod.cfg(37, 2) Hint: added path: '/Users/isak/.babel/pkgs/' [Path]
Hint: used config file '/Users/isak/src/softlib/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: sheshonshtore [Processing]
Hint: times [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Error: internal error: computeRecSizeAux()
No stack traceback available
On Mac OS X.
Metadata
Metadata
Assignees
Labels
No labels